DATA Step, Macro, Functions and more

Sending Email with SAS 9.3

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 92
Accepted Solution

Sending Email with SAS 9.3

Hello,

I'm trying to send email from a data step using SAS 9.3.  I believe that I can configure my email client in an options statement.  However, when I do so and attempt to send myself a test email, I get the following error message: "ERROR: Email: The connection was reset by a peer."  Note I'm running Windows 7 (64 bit) and want to send the email using the smtp protocol.  Here's my code:

options emailsys=smtp emailid="xxxxxxx@sbcglobal.net" emailpw="xxxxxxx" emailhost=outbound.att.net  emailport=465;

filename mymail email "xxxxxxx@sbcglobal.net" subject="test message" lrecl=256;

   data _null_;

      file mymail;

      put 'hello there';

   run;

Are there any errors in the above?  Also, here's the link to the ATT smtp settings.  At the top of the page they state that if you setup your email account after June 2011 you can't use an email client.  I setup my account several years ago, so I don't think that's the issue.

Email server settings (POP and SMTP) - AT&T  DSL High Speed Support 

Any help or advice would be greatly appreciated!  Thank you!

-Bill


Accepted Solutions
Solution
‎07-28-2013 08:56 AM
Valued Guide
Posts: 3,208

Re: Sending Email with SAS 9.3

Billd, Could be with 9.4.  You also are getting SAS/secure with that, no dedicated license anymore.

SAS(R) 9.4 System Options: Reference (EMAILHOST= System Option) ssl is mentioned

---->-- ja karman --<-----

View solution in original post


All Replies
Valued Guide
Posts: 3,208

Re: Sending Email with SAS 9.3

See:
Simple Mail Transfer Protocol - Wikipedia, the free encyclopedia  The SMTP protocol is missing by design login and encryption.
AT&T is mentioning secured SMTP (SSL) something we are missing at SAS docs

SAS(R) 9.4 System Options: Reference (EMAILAUTHPROTOCOL= System Option) may be this one is missing.

An other is that SMTP is well known to send mail MAPI also a good approach is the default protoc at Windows

SAS(R) 9.4 Companion for Windows (EMAILSYS System Option: Windows)  

Some sample/notes

http://support.sas.com/resources/papers/proceedings13/023-2013.pdf

---->-- ja karman --<-----
Frequent Contributor
Posts: 92

Re: Sending Email with SAS 9.3

Jaap - Thanks for the references.  Much appreciated

I was able to send an email with SAS!  Out of frustration I went through all the web email accounts that I have and surprisingly the only that worked was AOL. Here's the code that I used:

options emailsys=smtp emailauthprotocol=login emailid="xxxxx@aol.com" emailpw="xxxxxx" emailhost=smtp.aol.com  emailport=587;

filename mymail email "xxxxxx@sbcglobal.net" subject="Test" lrecl=256;

   data _null_;

      file mymail;

      put 'Hello!';

   run;

Note I tried to use code above to send email from my sbcglobal (ATT) account.  Tried all sorts of server/port combinations as well as specifying emailauthprotocol = login and plain. Nothing worked.  This is probably because as Jaap pointed out (thanks again) ATT requires SSL.  Therefore, I believe my SAS code was fine.  It doesn't seem possible to send email with ATT right now.  Perhaps in SAS 9.4, we'll be able to send email the SSL protocol.

Solution
‎07-28-2013 08:56 AM
Valued Guide
Posts: 3,208

Re: Sending Email with SAS 9.3

Billd, Could be with 9.4.  You also are getting SAS/secure with that, no dedicated license anymore.

SAS(R) 9.4 System Options: Reference (EMAILHOST= System Option) ssl is mentioned

---->-- ja karman --<-----
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1683 views
  • 3 likes
  • 2 in conversation