DATA Step, Macro, Functions and more

Gmail SMTP Email Error

Reply
Contributor
Posts: 34

Gmail SMTP Email Error

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

Super User
Posts: 11,343

Re: Gmail SMTP Email Error

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

Contributor
Posts: 34

Re: Gmail SMTP Email Error

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

Super User
Posts: 11,343

Re: Gmail SMTP Email Error

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.

Contributor
Posts: 34

Re: Gmail SMTP Email Error

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

Ask a Question
Discussion stats
  • 4 replies
  • 285 views
  • 0 likes
  • 2 in conversation