Help with smtp.h

HarryBrock

New Member
The code below works for when I have one email address in tableName.EmailList but if I have more than one email address in the field it does not send out mails.
Some of the email address have an "," or ";" or a space between in the database. Edit it seem that it work with an "," or ";" between them but if there is new line it does not work.


Could someone help point me in the direction on how to fix this problem?

Code:
                 RUN smtpmailv5_8c.p (
                 INPUT "smtp.Server.com:587", /*mailhub*/
                 INPUT tableName.EmailList, /*EmailTo--- pulled from the database table*/
                 INPUT tableName.loginName, /*EmailFrom --- loginName from the database table*/
                 INPUT "",/*EmailCC*/
                 INPUT "", /*Attachments*/
                 INPUT "", /*LocalFiles*/
                 INPUT "Subjuect goes here", /*Subject*/
                 INPUT theBody, /*Body---- a char/string*/
                 INPUT "type=text/html:charset=us-ascii:filetype=ascii", /*MIMEHeader*/
                 INPUT "TEXT", /*BodyType*/
                 INPUT 3, /*Importance*/
                 INPUT TRUE, /*doAUth*/
                 INPUT "base64",
                 INPUT tableName.loginName, /* loginName */
                 INPUT tableName.password, /* password */
                 OUTPUT oSuccessful, /*oSuccessful*/
                 OUTPUT cMess ) NO-ERROR.  /*vMessage*/
                 rpt = "".
 
The code below works for when I have one email address in tableName.EmailList but if I have more than one email address in the field it does not send out mails.
Some of the email address have an "," or ";" or a space between in the database. Edit it seem that it work with an "," or ";" between them but if there is new line it does not work.

You will need to remove the new lines, e-mail addresses must be separated by comma or semi-colon (which is replaced with commas). Depending on if the new lines indicate a new e-mail address or are simply an additional separator you will need to:

Code:
REPLACE( tablename.emaillist, "~n", "," )

or

Code:
REPLACE( tablename.emaillist, "~n", "" )

Your newline may also be a ~r or a ~r~n, but I can't guess that from here...
 
Back
Top