I am trying to add some text to a daily process that creates some PDF's, attaches them to an email, writes a proc tabulate table to the body of the email and sends. I normally would use a data _null_ and put statement to write text to the body of the email, but that seems to generate a second email rather than writing to the same email. I have tried ODS HTML TEXT as well with the same result. Does anyone know how to accomplish this? Thanks!
/* Send Email */
option emailhost='localhost';
filename mymail email
from="me"
sender="me"
to= ("me")
subject="Tracking"
content_type="text/html"
attach = ('Sample1.pdf' 'Sample2.pdf'');
ods MSOffice2K
body=mymail
style=BarrettsBlue;
<proc tabulate code>
ods msoffice2k close;
goptions reset=all;
Try using the ODS MSOffice2K TEXT= option to add your text that you would like to display in the body of the email.
filename mymail email
to= ("me.com")
subject="Tracking"
content_type="text/html";
ods MSOffice2K
body=mymail
style=BarrettsBlue;
ods msoffice2k text="this is a test";
proc tabulate data=sashelp.class;
class age;
var height;
table age,height;
run;
ods msoffice2k close;
Try using the ODS MSOffice2K TEXT= option to add your text that you would like to display in the body of the email.
filename mymail email
to= ("me.com")
subject="Tracking"
content_type="text/html";
ods MSOffice2K
body=mymail
style=BarrettsBlue;
ods msoffice2k text="this is a test";
proc tabulate data=sashelp.class;
class age;
var height;
table age,height;
run;
ods msoffice2k close;
Thanks. Works perfectly. Might you also now how to control line breaks in ods MSOffice2K? When I use the HTML breaks I would use for ODS HTML, it does not apply them. Or how to control the font? Style(fontweight=BOLD) does not seem to work.
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.