0

Trying to send email using sas and how do you deal with an apostrophe in the email address such as email_address_txt="Patrick O'Grady@acme.com";

put "!em_to!" EMAIL_ADDRESS_TXT ;

ERROR: Email: 501 5.1.3 Invalid address WARNING: Bad e-mail address: Patrick O

Richard C
  • 171
  • 12

1 Answers1

0

It is SMTP server error not SAS error. You should check settings on the server and adjust them to accept those kind of characters.

Also to include space or special characters in email address you must put local part of address in quotes like in code below. What characters are allowed in an email address?

My SMTP server won't accept this either but maybe your will.

filename test email;
data test;
   file test;
   EMAIL_ADDRESS_TXT='"Patrick O''Grady"@acme.com';
   put "!em_to!" EMAIL_ADDRESS_TXT;
run;
Community
  • 1
  • 1
fl0r3k
  • 619
  • 5
  • 9