TMAIL

TMAIL

Postby MarcoBoschi » Thu Apr 15, 2010 3:40 pm

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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: TMAIL

Postby Davide » Fri Apr 16, 2010 1:12 am

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
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: TMAIL

Postby MarcoBoschi » Fri Apr 16, 2010 6:46 am

Ok Davide thanks
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], jmartial, Marc Venken and 109 guests