BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MG18
Lapis Lazuli | Level 10

Hi All,

 

I running below code from LSF(which run on Batchserver) :- 

 

Code :- 

 

 FILENAME mail EMAIL

 TO=(" mXX.bi@XXXmail.com "  )

  SUBJECT="DAILY ADVANCES ABOVE 1 CRORE." CONTENT_TYPE="text/html";

  ODS LISTING CLOSE;

  ODS HTML BODY=mail;

  PROC PRINT DATA=DAILY_ADVANCES_ABV_1CRORE;

    RUN;

    ODS HTML CLOSE;

    ODS LISTING;

 

 

But it fails saying that 

ERROR: Email:the connection was refused 

 

Can You please guide me how to resolve this error.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

You should be able to add the OPTIONS statement at the start of your SAS program.  It might depend on your version of SAS -- I think in older versions the EMAILSYS and EMAILHOST options were "startup" options that need to go in a config file.  But in recent versions, these can go in your program on an OPTIONS statement.

 

As far as the value to put in the EMAILHOST -- that information probably needs to come from your IT dept.  It needs to be an SMTP server that any e-mail client can access.  Depending on your setup, you might also need to supply credentials.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Even if it's kinda old, I think this is still valid.

Also, be aware of userid being used (authorization problems...?)

 

http://support.sas.com/kb/18/363.html

Data never sleeps
ChrisHemedinger
Community Manager

Make sure you've set the EMAILHOST and EMAILSYS options, as well as any needed EMAILUSER/EMAILPW credentials (sometimes not needed).


Simple example:

 

options 
  emailhost='mailserver.company.com' 
  emailsys=smtp;

More complex (this is using GMail😞

 

options emailhost=
 (
   "smtp.gmail.com" 
   /* alternate: port=487 SSL */
   port=587 STARTTLS 
   auth=plain 
   /* your Gmail address */
   id="your_address@gmail.com"
   /* optional: encode PW with PROC PWENCODE */
   pw="your_password" 
 )
;
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
MG18
Lapis Lazuli | Level 10

hI Chris ,

 

Thank for ur reply.

Please tell me how to do this or which file should have this EMAIL host entry .

 

many Thanks in advance.......

ChrisHemedinger
Community Manager

You should be able to add the OPTIONS statement at the start of your SAS program.  It might depend on your version of SAS -- I think in older versions the EMAILSYS and EMAILHOST options were "startup" options that need to go in a config file.  But in recent versions, these can go in your program on an OPTIONS statement.

 

As far as the value to put in the EMAILHOST -- that information probably needs to come from your IT dept.  It needs to be an SMTP server that any e-mail client can access.  Depending on your setup, you might also need to supply credentials.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 5756 views
  • 0 likes
  • 3 in conversation