To All
I am trying to build a single array of e-mail addresses and then pass that array to tsmtp ( smtp e-mail) ..
Here is the basic code :
go thru a loop to get e-mail addresses :
aCC := {}
oRsSpon:MoveFirst()
DO WHILE .not. oRsSpon:eof
AADD( aCC, {alltrim(oRsSpon:Fields("sponsorid"):Value)+"@"+alltrim(oRsSpon:Fields("domain"):Value)} )
oRsSpon:MoveNext()
ENDDO
Then pass this array to the SMTP Class :
oWndMdi:SetMsg( "Sending Reporting noticication to "+cTO )
WSAStartup()
oOutMail := TSmtp():New( cIP := GetHostByName( cHOST ) )
oOutMail:bConnecting = { || oWndMdi:SetMsg( "Connecting to "+cHOST ) }
oOutMail:bConnected = { || oWndMdi:SetMsg( "Connected" ) }
oOutMail:bDone = { || oWndMdi:SetMsg( "Message sent successfully" ) }
oOutMail:SendMail( cFROM,; // From
{ cTO },; // To
cMESSAGE,; // Msg Text
cSUBJECT,;
{"C:\DBTMP\PROJINFO.BAT"},; // attachment
aCC, ; // cc array <-- BLOWS HERE
{ }, ; // bc
.F., ; // no return receipt
NIL ) // not html
I know everything is correct .. if I use {} for the cc section the e-mail is sent . .something about creating and passing the array is wrong. Here is what the cc array should look like :
{"rick@email.com", "rick1@email.com", "rick2@email.com"}
Any suggestions ??
Rick Lipkin
SC Dept of Health, USA