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
AnandVyas
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.
AnandVyas
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;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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