如何在SAS电子邮件正文中插入html文本

时间:2016-08-03 14:52:15

标签: html email sas ods

您好,请大家帮我在SAS Email中插入带有字体选项的HTML文本。我尝试了下面的代码,但在主体中没有proc报告,输出是空白的。

enter code here

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

filename mymail email from =" someone@email.com"

to=("someone@email.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 ] someone@email.com} ^{newline 5}"

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

ods html close;
ods _all_ close;

enter code here

在此先感谢,我需要唯一的文本部分进行格式化,但不想包含任何过程报告。

1 个答案:

答案 0 :(得分:1)

请使用以下SAS代码发送带有HTML正文的电子邮件:

filename mymail email type='text/html' to="john.doe@stackoverflow.com" from="john.doe@stackoverflow.com" sender="john.doe@stackoverflow.com" subject="Hello, World";
data _NULL_;
file mymail;
    put '<font size=15>Hello, World!</font>';
run;