Hi guys
Here is the code can someone add to this so i am able to attach a document? like excel file "c:\1.xls" ?
Thanks!
Here is the code can someone add to this so i am able to attach a document? like excel file "c:\1.xls" ?
Code:
Function SendLotusEmail()
On Error GoTo Ett_Trap
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim ToName As String
Dim CCName As String
Dim BCCName As String
Dim objNotesField As Object
Dim Subject As String
Dim BodyText As String
Dim EmbedObject As Object
Dim strpath As String
Dim QRY As String
ToName = "email@domain.com"
CCName = "email@domain.com"
BCCName = ""
Subject = "This is a test"
BodyText = "body"
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.GETDATABASE("", "")
Call notesdb.OPENMAIL
Set notesdoc = notesdb.CREATEDOCUMENT
Call notesdoc.replaceitemvalue("Sendto", ToName)
Call notesdoc.replaceitemvalue("CopyTo", CCName)
Call notesdoc.replaceitemvalue("BlindCopyTo", BCCName)
Call notesdoc.replaceitemvalue("Subject", Subject)
Call notesdoc.replaceitemvalue("Body", BodyText)
Call notesdoc.Send(False)
Call notesdoc.Save(True, False)
Set notessession = Nothing
MsgBox "Email sent"
Ett_Trap_Exit:
Exit Function
Ett_Trap:
MsgBox Err.Description
Resume Ett_Trap_Exit
End Function
Thanks!