Hi Could you all please help me in inserting HTML Text with font options in SAS Email. I tried the below code but without proc report in body the output is blank.
filename mymail email from="santh@urbanpro.com"
to=("santh@urbanpro.com")
subject="Territory Sales"
content_type="Text/HTML"
attach = ("/sasdata/sas_codes/NewSales/SalesValid.xls" Content_type="application/excel");
ods _all_ close;
ODS ESCAPECHAR='^';
ods html body=mymail style=minimal;
title j=left font = verdana height=10pt color=black
title "Good Morning, ^{newline 2}
Attached is the Aug 2016 Sales Report. ^{newline 2}
Thanks and Regards, ^{newline 2}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Santh S} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Business Analyst} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] GR Team} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Client Analytics } ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] UnrbaPro} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] UBSC, Dekhi 400019, INDIA} ^{newline 2}
^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] TEL }
^{style [ FONT=(verdana,8Pt) color=black ] + 91 40 4090 1000} ^{newline 1}
^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] INTERNAL }
^{style [ FONT=(verdana,8Pt) color=black ] santh@urbanpro.com} ^{newline 5}"
;
proc report data=prod_list;
where type='XSell';
column (odr );
quit;
ods html close;
ods _all_ close;
I need the only text part with formating but dont want to include any proc report in the mail body.
I appreciate any help on this, Thanks in advance.
Can you post the log of an attempt with that code. From what you posted I expect to see a number of error messages.
Than you for the reply Ballardw,
infact there are no errors in log, but the body part is missing when I remove the Proc report code, else the output is fine as I required. attached is the screen shot which I required. Thanks in advance
Titles don't actually get sent to output unless there is something to "attach" the title to. Without the proc report there is not need for a "title" so that text doesn't get sent.
I don't use SAS for emails so I can't suggest a specific work around.
Thank you Ballardw,
will wait for any help in resolving my problem 🙂
Thank you Cynthia,
Yes, I tried with Datastep and now it is working. Thank you all for your prompt response.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.