How to send email from SAS EG

How to send mail from SAS EG

How to send mail from SAS EG ? Are you looking for the same stuck and have no idea how to send email from SAS code. We’re going to learn how to send email with attachment from SAS EG code.

/*—————————————————————–*/
/* How to send email from SAS code */
/*—————————————————————–*/

 

options emailhost=localhost;
FILENAME OUTFILE EMAIL "info@trenovision.com"
SUBJECT= "Trenovision SAS Tutorals"

TO= ("info@trenovision.com")
CC= "info@trenovision.com"
BCC= "info@trenovision.com"
CT ="text/html";
ods html
body=OUTFILE
style=JOURNAL;
title 'How to send mail from SAS EG';
proc print data=sashelp.class;run;
ods html close;

 

In the above example, we have send the email to info@trenovision.comĀ which contain sashelp.class dataset.You can modify the code as per your requirements.

To send email with attachment you just have to add below code.

attach=("C:\Users\trenovision\Documents\trenovision.pdf");

Hope things are now clear to you if you have any doubts you can comment. Happy learning !!