BookmarkSubscribeRSS Feed
skbhardwaj89
Calcite | Level 5

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

3 REPLIES 3
jakarman
Barite | Level 11

Does this thread help you?

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

---->-- ja karman --<-----
skbhardwaj89
Calcite | Level 5

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);


jakarman
Barite | Level 11

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

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
  • 3 replies
  • 3911 views
  • 1 like
  • 2 in conversation