BookmarkSubscribeRSS Feed
ddemilla
Fluorite | Level 6

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

 

http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/

 

My code is:

 

options emailhost=
(
"smtp.gmail.com" port=465
SSL auth=plain
id="myname@company.com"
pw="myPassword"
)
;


filename myemail email to="myname@company.com" subject="Test SAS Message";

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

filename myemail clear;

 

The error that I am receiving is:

 

Email: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1scc=1&plt=......> Please log in via your web browser and then try again. Learn more at http://support.google.com/mail/answer/78754 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,

Daniel

5 REPLIES 5
ballardw
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...

ddemilla
Fluorite | Level 6

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

 

https://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#p1v9dr6zep9p...

 

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

ballardw
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.

ddemilla
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!

Daniel

BruceBrad
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1830 views
  • 0 likes
  • 3 in conversation