santosh315345
santosh315345

Reputation: 23

how to insert html text in SAS email body

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.

enter code here

/*options errorabend;*/
%MACRO mail_send1();

filename mymail email from="[email protected]"

to=("[email protected]")

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 ] [email protected]} ^{newline 5}"

;

proc report data=prod_list;
where type='XSell';
column (odr );
quit;

ods html close;
ods _all_ close;

enter code here

Thanks in advance, I need the only text part with formating but dont want to include any proc report.

Upvotes: 1

Views: 4145

Answers (1)

Alex L.
Alex L.

Reputation: 56

Please use the following SAS code in order to send email message with HTML body:

filename mymail email type='text/html' to="[email protected]" from="[email protected]" sender="[email protected]" subject="Hello, World";
data _NULL_;
file mymail;
    put '<font size=15>Hello, World!</font>';
run;

Upvotes: 1

Related Questions