Problem while sending email from sas9.3

Reply
Occasional Contributor
Posts: 5

Problem while sending email from sas9.3

Dear All,


The code is giving connection time out ERROR when i am trying out to send a email to GMAIL server using smtp settings.

please help me out.

the code is as:


options emailsys=SMTP;
options emailport=465;
options emailauthprotocol=NONE;
options emailhost=smtp.gmail.com;
options NOEMAILFROM;
options emailid="skbhardwaj89@gmail.com";
options emailpw="XXXXXXX";
filename outbox email "skbhardwaj89@gmail.com" debug;

data _null_;
file outbox
to=("skbhardwaj89@gmail.com")
subject="My SAS Output"

;

put 'Folks,';
put 'program ran';
put 'It worked great!';
run;

Thanks in advance.

Regards!!

Sandeep Sharma

Trusted Advisor
Posts: 3,212

Re: Problem while sending email from sas9.3

Posted in reply to skbhardwaj89

Does this thread help you?

https://communities.sas.com/thread/48178

---->-- ja karman --<-----
Occasional Contributor
Posts: 5

Re: Problem while sending email from sas9.3

Thanks Jaap.

Now I change the code and executed it .It basically giving no ERROR in the log and log is reflecting that mail is sent but i didnot receive the mail. Idon't know what is the problem.Please guide

Here is the code:-

%MACRO email(SEmailid);
  FILENAME mymail EMAIL "NULL"
  TO="&SEmailid" ;
 
   data _null_;
    FILE mymail;
put 'Hello!';
run;
%MEND;

data MailDset;
input Email_ID $25.;
datalines;
sandeep52.s@gmail.com
;
run;

OPTIONS MLOGIC MPRINT SYMBOLGEN;
data _null_;
set MailDset;
call symput("V_EMAIL_ID",trim(EMAIL_ID));
run;

DATA _NULL_ ;
  CALL SYMPUT("SEmailid","&V_EMAIL_ID");
 
RUN;

%email(&SEmailid);


Trusted Advisor
Posts: 3,212

Re: Problem while sending email from sas9.3

Posted in reply to skbhardwaj89

As you read the other thread....
1/ you have to deal with firewall-s and routers.

2/ conflicting requirements like requirement of ssl (supported starting at 9.4)

You did not get a Syntax Error. That doesn't indicate the processing of sending was succesful.

Do not expect correct error messages or notes of something happening outside the SAS world.

SAS(R) 9.3 System Options: Reference, Second Edition ( EMAILAUTHPROTOCOL= System Option)
I would expect to be set to Yes as SMTP has normally no security by using valdiatied lines/machines (bulk mail).

Google Gmail:

Account must be set open to use IMAP/POP (go to mail-settings)

Checking SSL/TSL What Are the Gmail SMTP Settings? - About Email ...

Gmail is requiring SSL/TLS and SAS is supporting it with 9.4. Do you have 9.4?

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 3 replies
  • 1296 views
  • 1 like
  • 2 in conversation