Pages

Wednesday, December 23, 2009

Sending plain text notifications

'**********************************************************************************'@Author : Karthikeyan A
'@Purpose : send mails with plain text as body content
'@Type : Function
'@Name : sendPlainTextNotification
'@Param : sendTo As Variant,subject As String,body As String
'@Return : Boolean (has operation succeded, True stands for success and False stands for failure)
'**********************************************************************************
Function sendPlainTextNotification(sendTo As Variant,subject As String,body As String) As Boolean

'mark the flow of control getting inside the current function
sendPlainTextNotification=False

'declare all the objects and variables required for further manipulation
Dim session As NotesSession
Dim mailDoc As NotesDocument

'set the handle for the current database
Set session=New NotesSession

'create the mail document that is to be mailed
Set MailDoc=session.CurrentDatabase.CreateDocument

'define the attributres for the mail document
mailDoc.Form="Memo"
mailDoc.sendTo=sendTo
mailDoc.Subject=subject
mailDoc.Body=body

'mail the document
Call mailDoc.Send(False)

'mark the flow of control moving out of the curren function
sendPlainTextNotification=True

End Function

No comments:

Post a Comment