1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:
| procedure SendMailLotusNotes(const Subject, FileName, SenderEmail: String; CopyEmail: String; auto : Boolean); var oSession : OleVariant; oDB : OleVariant; oDoc : OleVariant; oRTitem : OleVariant; oWS : OleVariant; sMailserver : String; sMailFile : String;
begin oSession := CreateOleObject('Notes.Notessession');
sMailserver := ''; sMailFile := oSession.GETENVIRONMENTSTRING('Mailfile', True);
oDB := oSession.GETDATABASE(sMailserver, sMailFile);
oDoc := oDB.CREATEDOCUMENT; oDoc.SendTo := SenderEmail; oDoc.CopyTo := CopyEmail;
oDoc.subject := Subject; oDoc.ReturnReciept := True; oDoc.SaveMessageOnSend := True;
oDoc.Form := 'Memo'; oRTitem := oDoc.CREATERICHTEXTITEM('Body'); oRTitem.EMBEDOBJECT(1454, '', FileName);
case auto of true : begin oDoc.SEND(false); end; false : begin oWS := CreateOleObject('Notes.NotesUIWorkspace'); oWS.OpenDatabase(sMailserver, sMailFile); oWS.EDITDOCUMENT(True, oDoc); end; end; end; |