Posted ByRavikanth on January 28, 19102 at 00:18:04:
In Reply to: VB mail using Lotus Notes posted byNeelima Jadapalli on January 15, 19102 at 00:55:34:
Do you need Lotus Script(VB) to solve this problem?
If so here is the script.
Function SendMailMemo(sendTo As String, _
cc As String, _
bcc As String, _
subject As String, _
body As String, _
linkTo As NotesDocument) As Integer
On Error Goto ErrorHandler
Dim mailDb As New NotesDatabase("", "")
Dim mailDoc As NotesDocument
Dim rtItem As NotesRichTextItem
Call mailDb.OpenMail
If (mailDb.IsOpen = False) Then Call mailDb.Open("", "")
Set mailDoc = mailDb.CreateDocument
mailDoc.Form = "Memo"
mailDoc.SendTo = sendTo
mailDoc.CC = cc
mailDoc.BCC = bcc
mailDoc.Subject = subject
Set rtItem = mailDoc.CreateRichTextItem("Body")
Call rtItem.AppendText(body)
If Not(linkTo Is Nothing) Then
Call rtItem.AddNewLine(2)
Call rtItem.AppendDocLink(linkTo, "Double-click to open document")
End If
Call mailDoc.Send(False)
SendMailMemo = True
Exit Function
ErrorHandler:
Print "Error " & Str$(Err) & ": " & Error$
Resume TheEnd
TheEnd:
SendMailMemo = False
End Function
Thanks,
Ravikanth