BookmarkSubscribeRSS Feed
Fluorite | Level 6

I am using this fantastic blog by Chris Hemedinger to send emails through Gmail using SMTP on a Windows machine:


My code is:


options emailhost=
"" port=465
SSL auth=plain

filename myemail email to="" subject="Test SAS Message";

data _null_;
file myemail;
put "Hello!";
put "I can send emails using SAS!";

filename myemail clear;


The error that I am receiving is:


Email: 534-5.7.14 <> Please log in via your web browser and then try again. Learn more at r40sm11865438ioe.20 - gsmtp


I have read almost all of the SUGI literature out there and can't find anything regarding this issue. The issue seems to be with authentication through Gmail. I realize that this problem may be beyond the scope of the SAS platform but any help would be appreciated. 


Thank you,


Super User

Did you check you email program for the parameters it currently uses? You have something besides "plain" such as 2.0 or 3.0 needed for ssl, and possibly using POP instead of SMTP. No guarantees but that may give you some hints.


In my case though, I generally default to "Google doesn't like me" and go elsewhere...

Fluorite | Level 6

The only valid values for "auth=" are login and plain:


Both do not work in this case. I have also gone into my setting in Gmail and allowed external clients to use the SMTP interface. Is there a Web service you would recommend in place of google? Sadly, I do not have outlook on my networked machine...

Super User

Does the machine you are running SAS on have any email other than gmail? You might check with your IT to see if they have any SMTP server.

Look at the SAS options that start with EMAIL for some additional informaton that may need to be set.

Fluorite | Level 6

The machine that we run SAS on is a bare bones server dedicated for SAS use so there isn't any email software on it. I'm sure that we can get a licence to outlook if necessary but I was just trying to fix the problem without having to pay for it. My company might have a dedicated SMTP server also, I'm not sure it is worth the headache of dealing with though. This is one of those "nice to haves" instead of "need to have".


Thank you for your help ballardw!


Lapis Lazuli | Level 10

For those coming late to this old thread, the blog post at the top has been updated to reflect Gmail changes. You have to enable 'less secure' connections for this to work.


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 in conversation