|
It's working now. I don't get it. It must feel better today. Sorry. BTW, here's my code. We still use html_out. I can't afford to rewrite 600+ programs.
PARAMETER RECIPLIST,SENDERADD,SENDERNAME,MSUBJ,;
MBODY,MATTACH,MCC,MBCC
IF PARAMETERS() < 8 MBCC="" ENDIF IF PARAMETERS() < 7 MCC="" ENDIF IF PARAMETERS() < 6 MATTACH="" ENDIF IF FILE(MBODY) MBODY=FILETOSTR(MBODY) ENDIF MYSMARTMAIL =CREATEOBJECT("aspSmartMail.SmartMail") *SMTP Mail Server MYSMARTMAIL.SERVER = "mail.spectrumdata.com" MYSMARTMAIL.ORGANIZATION="Spectrum Data Mgmt., Inc." MYSMARTMAIL.XMAILER="Spectrum Email" MYSMARTMAIL.XHEADERS.ADD("X-SPECTRUM","Spectrum Email") MYSMARTMAIL.DATETIME=DATETIME() MYSMARTMAIL.CONFIRMREAD=.F. MYSMARTMAIL.RETURNRECEIPT=.F. IF "<HTML" $ UPPER(MBODY) MYSMARTMAIL.CONTENTTYPE="text/html" ELSE MYSMARTMAIL.CONTENTTYPE="text/plain" ENDIF MYSMARTMAIL.SENDERNAME = SENDERNAME MYSMARTMAIL.SENDERADDRESS = SENDERADD FOR I=1 TO OCCURS(";",RECIPLIST)+1 THISRECIP=BRKCOMMA(RECIPLIST,I,";") THISADDR=BRKCOMMA(THISRECIP,1,",") THISNAME=BRKCOMMA(THISRECIP,2,",") MYSMARTMAIL.RECIPIENTS.ADD(THISADDR, THISNAME) ENDFOR IF !EMPTY(MCC) *MYSMARTMAIL.CCS.ADD("sales@spectrumdata.com","Sales") * FUTURE. BREAK UP LIKE RECIPLIST ENDIF *BCC IF !EMPTY(MBCC) *MYSMARTMAIL.BCCS.ADD("sales@spectrumdata.com","Sales") * FUTURE. BREAK UP LIKE RECIPLIST ENDIF *REPLYTOS MYSMARTMAIL.REPLYTOS.ADD(SENDERADD,SENDERNAME) * ATTACHMENTS IF !EMPTY(MATTACH) FOR I=1 TO OCCURS(";",MATTACH)+1 THISATTACH=BRKCOMMA(MATTACH,I,";") MYSMARTMAIL.ATTACHMENTS.ADD(THISATTACH) ENDFOR ENDIF *Message MYSMARTMAIL.SUBJECT = MSUBJ MYSMARTMAIL.BODY = MBODY * Capture send errors SENDFAILED = .F. OLDERR = ON("ERROR") ON ERROR SENDFAILED = .T. *Send the message MYSMARTMAIL.SENDMAIL * Reset error handler ON ERROR &OLDERR IF SENDFAILED HTML_OUT=HTML_OUT+'<BR>Failed to send e-mail. ' + ; 'The error message was:<br>' + MESSAGE()+'<BR>' RETURN .F. ENDIF RETURN .T. |