DATA Step, Macro, Functions and more

An Email from sas

Accepted Solution Solved
Reply
Contributor
Posts: 48
Accepted Solution

An Email from sas

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.

 

 


Accepted Solutions
Solution
‎02-07-2017 05:22 AM
Community Manager
Posts: 2,953

Re: An Email from sas

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.

View solution in original post


All Replies
Super User
Posts: 5,426

Re: An Email from sas

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
Community Manager
Posts: 2,953

Re: An Email from sas

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" 
 )
;
Contributor
Posts: 48

Re: An Email from sas

Posted in reply to ChrisHemedinger

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

Solution
‎02-07-2017 05:22 AM
Community Manager
Posts: 2,953

Re: An Email from sas

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 174 views
  • 0 likes
  • 3 in conversation