Write and run SAS programs in your web browser

How to send emails from SAS using SAS Studio online

Reply
Occasional Contributor
Posts: 14

How to send emails from SAS using SAS Studio online

I created an account for Online SAS Studio using https://odamid.oda.sas.com/SASStudio/  for practicing my SAS skills.

 

Following Chris Hemedinger blog (http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/), I tried to implement the learning.

 

I intend to send email TO gmail, for which if I use following lines and it works like a charm (read on to get to know the problem)

 

filename myemail EMAIL
  to="myuserid@gmail.com" 
 subject="Hi";
 data _null_;
  file myemail;
  put "Hello Friend";
run;
filename myemail clear;

 

However, when I use below lines of code on top of that, it errors out,

 

options emailhost=
 (
   "smtp.gmail.com" port=587
   STARTTLS auth=plain 
   id="<my-gmail-userid>"
   /*pw="my-gmail-password" */
 )
;

 

So basically it's erroring out when I am trying to use GMAIL as a SENDER.

 

I have already done the following :-

a) Enabled "Less secure apps" on my Gmail account in order to send e-mail from a non-Google application (including SAS).

b) Tried port 587, and STARTTLS instead of SSL.

 

Here is what the log looks like,

 

NOTE: The file MYEMAIL is:

E-Mail Access Device
 
ERROR: Email: 535-5.7.8 Username and Password not accepted. Learn more at
ERROR: Email: 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y3sm19145222pfy.36 - gsmtp
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 1.60 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2265.09k
OS Memory 29088.00k
Timestamp 09/11/2016 07:32:21 PM
Step Count 14 Switch Count 65
Page Faults 0
Page Reclaims 1277
Page Swaps 0
Voluntary Context Switches 236
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 0
 
Do the experts here have any help to offer? Please advise.
 
Regards,
Arpit
Grand Advisor
Posts: 17,338

Re: How to send emails from SAS using SAS Studio online

Not likely. 

 

To send email you need access to an email server and the online version won't have it. But you know it's possible if you ever do need to do this.

 

Remember that these are learning editions, not full editions of SAS.

SAS Super FREQ
Posts: 8,719

Re: How to send emails from SAS using SAS Studio online

Hi:
And, in addition to Reeza's reasons for why it isn't likely, another reason why it isn't likely is that in order to send email from a SAS program, there MUST be SAS e-mail options turned on when SAS starts up. And, since you do not have permission to alter the SAS start-up file, it is unlikely that this will work for you. Although, it IS possible to send email from SAS, once you are on a full system, where you can ask you administrators to implement the options you need to make it work.

cynthia
Occasional Contributor
Posts: 14

Re: How to send emails from SAS using SAS Studio online

Thank you for your advice!
Occasional Contributor
Posts: 14

Re: How to send emails from SAS using SAS Studio online

Ok, thanks!
Ask a Question
Discussion stats
  • 4 replies
  • 316 views
  • 0 likes
  • 3 in conversation