Use SendMail.Dg //**************************************************************************** // $Module type: PROCEDURE // $Module name: DoSendNewMail // $Author : Vincent Oorsprong // Created : 18/09/98 @ 13:38 // // Description // This method will open the send mail dialog to compose a new message. // Specify username, password for mapi logon function if necessary. // Logs on to mail system if not already logged on. Initializes variables // and arrays for new mail message prior to activating SendNewMail Dialog // to allow new mail composition. On return from SendNewMail Dialog, remain // logged on to mail system if previous session exists, otherwise logoff. // // $Rev History // 27/10/99 Changed from SEND LOGON to GET LOGON // Changed from SEND LOGOFF to GET LOGOFF // 18/09/98 VO Module header created //**************************************************************************** Procedure DoSendNewMail String sEmailName String sEmailAddress Integer iRetval iVoid hoSendNewEmailDialog hoMapiSession Handle hSessionId hPreviousSessionId Move oSendNewEmailDialog To hoSendNewEmailDialog Move oMapiSession To hoMapiSession Get phSessionId Of hoMapiSession To hPreviousSessionId If (hPreviousSessionId = 0) Begin Get Logon Of hoMapiSession "" "" MAPI_NEW_SESSION To iRetval If (iRetval <> SUCCESS_SUCCESS) Begin Get Logon Of hoMapiSession "" "" (MAPI_LOGON_UI + MAPI_NEW_SESSION) To iRetval If (iRetval <> SUCCESS_SUCCESS) Begin Send Stop_Box ("Errorcode:" * String (iRetval)) "MAPI Logon error" End End End Get phSessionId Of hoMapiSession To hSessionId If (hSessionId <> 0) Begin Send DoEraseAllContents To hoSendNewEmailDialog Send DoInitAddressee To hoSendNewEmailDialog sEmailName sEmailAddress Send Popup_Modal To hoSendNewEmailDialog If (hPreviousSessionId = 0) Begin Get Logoff Of hoMapiSession To iVoid Get phSessionId Of hoMapiSession To hSessionId If (hSessionId <> 0) Begin Send Stop_Box "MAPI logoff failed!" End End End Else Begin Send Stop_Box "MAPI logon failed!" End End_Procedure // DoSendNewMail