James,
could you explain me the difference between
1) AADD( oMail:aRecipients, aTo ) and
2) oMail:aRecipients := aTo
Only in the first case, it works.
Thanks in advance
Marco
#include "fivewin.ch"
#include "mail.ch"
function main()
sendMail({"jbott@compuserve.com"},"Test mail", "Message...", {"c:\config.sys"})
return nil
function sendMail(aTo,cSubject,cMsg,aFiles)
local oMail
default cSubject:=""
DEFINE MAIL oMail ;
SUBJECT OemToAnsi(cSubject) ;
TEXT OemToAnsi(cMsg);
FROM USER // Use this to get the dialog box for the user
AADD( oMail:aRecipients, aTo ) // works fine
oMail:aRecipients := aTo ) // does not work!
if aFiles!=nil
oMail:aFiles:=ACLONE(aFiles)
endif
ACTIVATE MAIL oMail
IF oMail:nRetCode#0
MsgAlert("The message could not be sent!","Alert")
ENDIF
return nil