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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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" 
 )
;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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