IF ISCLEAR(AutoLotusNoteSession) THEN CREATE(AutoLotusNoteSession); { IF ISCLEAR(Vardb) THEN CREATE(Vardb); IF ISCLEAR(Vardoc) THEN CREATE(Vardoc); MESSAGE('2'); IF ISCLEAR(VarrtItem) THEN CREATE(VarrtItem); } AutoLotusNoteSession.Initialize('notespassword'); mailServer := AutoLotusNoteSession.GetEnvironmentString('MailServer',TRUE); mailFile := AutoLotusNoteSession.GetEnvironmentString('MailFile',TRUE); Vardb := AutoLotusNoteSession.GetDatabase(mailServer,mailFile); //Vardb := AutoLotusNoteSession.GetDatabase('',''); IF NOT Vardb.IsOpen THEN BEGIN Vardb.Open; MESSAGE('open'); END ELSE MESSAGE('close'); Vardoc := Vardb.CreateDocument; Vardoc.AppendItemValue('Form', 'Memo'); Vardoc.AppendItemValue('SendTo', VarToMail); // Create CopyTo value for ccRecipients //Call doc.AppendItemValue("CopyTo", ccRecipient) //' Create SendTo value for bccRecipients //Call doc.AppendItemValue("BlindCopyTo", bccRecipient) //' Create Subject value Vardoc.AppendItemValue('Subject', VarSubject); //' Create Body of email value //Debug.Print BodyText VarrtItem := Vardoc.CreateRichTextItem('Body'); VarrtItem.AppendText(VarBody); { //' Embed Attachment to Body If Attachment <> "" Then Set obj = VarrtItem.EmbedObject(EMBED_ATTACHMENT, "", Attachment) End If } Vardoc.SaveMessageOnSend(TRUE); //' Send Email document Vardoc.Send(FALSE,VarToMail); CLEAR(AutoLotusNoteSession); CLEAR(AutLotusNoteDocument); CLEAR(Vardb); CLEAR(Vardoc); CLEAR(VarrtItem);