'在notes 7.0 Excel2003上测试通过
'必须先引入对象lotus domino Objects对象
Sub NotesSendMail()
Dim session As New NotesSession
Dim userdbname As String
Dim doc As NotesDocument
session.Initialize ("password")
Dim db As NotesDatabase
' Dim body As NotesRichTextItem
Set db = session.GetDatabase("domino server name", "Mail database (*.nsf)", False)
Set doc = db.CreateDocument
ret = doc.AppendItemValue("Form", "Memo")
With doc
.AppendItemValue "Form", "Memo"
.AppendItemValue "Subject", "Test E Mail"
.AppendItemValue "SendTo", "mail@123.net"
Set body = .CreateRichTextItem("Body")
With body
.AppendText "This is a Test Mail"
End With
.SaveMessageOnSend = True
.Send False
End With
Set body = Nothing
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub
Dim userdbname As String
Dim doc As NotesDocument
session.Initialize ("password")
Dim db As NotesDatabase
' Dim body As NotesRichTextItem
Set db = session.GetDatabase("domino server name", "Mail database (*.nsf)", False)
Set doc = db.CreateDocument
ret = doc.AppendItemValue("Form", "Memo")
With doc
.AppendItemValue "Form", "Memo"
.AppendItemValue "Subject", "Test E Mail"
.AppendItemValue "SendTo", "mail@123.net"
Set body = .CreateRichTextItem("Body")
With body
.AppendText "This is a Test Mail"
End With
.SaveMessageOnSend = True
.Send False
End With
Set body = Nothing
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub