Page 1 of 1

TMAIL

PostPosted: Thu Apr 15, 2010 3:40 pm
by MarcoBoschi
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

Re: TMAIL

PostPosted: Fri Apr 16, 2010 1:12 am
by Davide
Marco,
MarcoBoschi wrote:could you explain me the difference between

1) AADD( oMail:aRecipients, aTo ) and
2) oMail:aRecipients := aTo

Only in the first case, it works.

aTo is an array of arrays. For example:

{ {"John Doe", "john@doe.com"},;
{"Jane Roe", "jane@roe.com"} }

Hi,
Davide

Re: TMAIL

PostPosted: Fri Apr 16, 2010 6:46 am
by MarcoBoschi
Ok Davide thanks