FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Genetating an array of cc addresses to Pass thru Tsmtp
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Genetating an array of cc addresses to Pass thru Tsmtp
Posted: Sun Aug 17, 2008 11:18 PM

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

Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Genetating an array of cc addresses to Pass thru Tsmtp
Posted: Mon Aug 18, 2008 03:59 AM

Rick

Why the array in the add
*
AADD( aCC, {alltrim(oRsSpon:Fields("sponsorid"):Value)+"@"+alltrim(oRsSpon:Fields("domain"):Value)} )
*

AADD( aCC, alltrim(oRsSpon:Fields("sponsorid"):Value)+"@"+alltrim(oRsSpon:Fields("domain"):Value) )

Regards

Colin

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Genetating an array of cc addresses to Pass thru Tsmtp
Posted: Mon Aug 18, 2008 12:28 PM

Colin

I will try it .. guess I have been looking at this code too long ..

Rick

Continue the discussion