Call SendNotesMail( "this is a test subject" , "C:\xxx.vbs" , "samuelpan","my message" , True)
Sub SendNotesMail(Subject , Attachment , Recipient , BodyText , SaveIt )
'Set up the objects required for Automation into lotus notes
Dim Maildb 'The mail database
Dim UserName 'The current users notes name
Dim MailDbName 'THe current users notes mail database name
Dim MailDoc 'The mail document itself
Dim AttachME 'The attachment richtextfile object
Dim Session 'The notes session
Dim EmbedObj 'The embedded object (Attachment)
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
End If
MailDoc.SEND 0, Recipient
'清除
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub