BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vivinkumar
Fluorite | Level 6

Dear,

 

I am trying to configure Amazon Simple Email Service (SES)  with SAS 9.4 to send email notifications and reports from SAS.

 

I have configured AWS SES but trying to find any sample code or SAS connect to configure in SAS.

Tried the following code but I am getting only the authentication error.

 

/*sample code*/
options emailsys=smtp;
options emailport=25;
options emailhost="email-smtp.amazon.com";
options emailid="test@domain.com";
options emailpw="******";

 

FILENAME Mailbox EMAIL 'test@domain.com'
Subject='Test Mail message';
DATA _NULL_;
FILE Mailbox;
PUT "Hello";
PUT "This is a Test email";
RUN;

 

ERROR: Email: 530 Authentication required

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
vivinkumar
Fluorite | Level 6

I have referred this document - https://support.sas.com/kb/53/215.html

 

After applying this sample I can able to send email via AWS Simple Email Service (SES).

 

Sample Code:

options emailsys=smtp;
options emailhost=("email-smtp.amazonaws.com" STARTTLS auth=LOGIN id="SES-SMTP-USER_NAME" pw="SES-SMTP-PASSWORD" port=25);

filename outbox email from="email-congifured-in-ses@domain.com" ;
data _null_;
file outbox
to=("to@domain.com")
subject="My SAS Output"
;
put 'It worked great!';
run;

View solution in original post

5 REPLIES 5
Anand_V
Ammonite | Level 13

Hi @vivinkumar 

 

Check this KB link on Troubleshooting guidelines for successfully sending an SMTP e-mail from SAS® software . It is to check if SMTP email is working successfully outside of SAS first.

vivinkumar
Fluorite | Level 6
Thanks Anand.
When I try the telnet command I am getting the following response. Do I need to setup additional configuration for SMTP?

220 email-smtp.amazonaws.com ESMTP SimpleEmailService-****** ###########
451 4.4.2 Timeout waiting for data from client.

Connection to host lost.
Anand_V
Ammonite | Level 13

I am not sure if any config is required for SMTP, but here is a guide from AWS on troubleshooting timeout issues.

https://aws.amazon.com/premiumsupport/knowledge-center/smtp-connectivity-timeout-issues-ses/

 

vivinkumar
Fluorite | Level 6
Thanks Anand.
I have retested the telnet command with additional parameters and I am getting the following authentication error.

220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-****** #######
helo domain.com
250 email-smtp.amazonaws.com
mail from: mail@domain.com
530 Authentication required

Still I am not clear what authentication and how to provide it.

Thanks
Vivin
vivinkumar
Fluorite | Level 6

I have referred this document - https://support.sas.com/kb/53/215.html

 

After applying this sample I can able to send email via AWS Simple Email Service (SES).

 

Sample Code:

options emailsys=smtp;
options emailhost=("email-smtp.amazonaws.com" STARTTLS auth=LOGIN id="SES-SMTP-USER_NAME" pw="SES-SMTP-PASSWORD" port=25);

filename outbox email from="email-congifured-in-ses@domain.com" ;
data _null_;
file outbox
to=("to@domain.com")
subject="My SAS Output"
;
put 'It worked great!';
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 5587 views
  • 3 likes
  • 2 in conversation