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.
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.
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
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"
)
;
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.......
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.