/* initialisation */
Integer li_ret
invo_NotesSession = CREATE OLEObject
li_ret = invo_NotesSession.ConnectToNewObject("Notes.NotesSession")
... do your checks....
/* send the email */
OleObject ole_database, ole_document, ole_richtext, ole_attach
ls_user = invo_NotesSession.GETENVIRONMENTSTRING("MailFile", True)
ls_server = invo_NotesSession.GETENVIRONMENTSTRING("MailServer", True)
ole_database = invo_NotesSession.GETDATABASE(ls_server, ls_user)
ls_title = ole_database.Title
If IsNull(ls_title) OR Len(Trim(ls_title)) < 1 Then
gnv_app.of_errmsg("Notes communication error!~n~rYou may need to log onto notes before proceeding!")
Return -1
End If
ole_document = ole_database.CREATEDOCUMENT
ole_richtext = ole_document.CREATERICHTEXTITEM("Body")
ls_recipients[1] = as_to[1]
ls_text = as_text + "~n~r~n~r"
ole_richtext.APPENDTEXT(as_text)
li_attachments = UpperBound(as_attach[])
For li_count = 1 To li_attachments
ls_attach = as_attach[li_count]
ole_attach = ole_richtext.EMBEDOBJECT(1454, "", ls_attach)
Next
ole_document.Form = "Memo"
ole_document.Subject = as_subject
ole_document.sendto = ls_recipients
ole_document.posteddate = DateTime(Today(), Now())
ole_document.Save( True, False, True)
ole_document.SEND (False, ls_recipients)
Destroy invo_NotesSession