如何在电子邮件正文中嵌入图像和表格(proc print)?SAS
我将图像保存在一个位置。我可以在电子邮件正文中发送图像,也可以在电子邮件正文中发送表格(使用proc打印) 问题是我无法将图像和表格都放在电子邮件的正文中 这是我试过的代码如何在电子邮件正文中嵌入图像和表格(proc print)?SAS,sas,Sas,我将图像保存在一个位置。我可以在电子邮件正文中发送图像,也可以在电子邮件正文中发送表格(使用proc打印) 问题是我无法将图像和表格都放在电子邮件的正文中 这是我试过的代码 filename report "c:/users/test.html"; filename SEND email to ="*****@****.com" from="****@****.com" attach=("/C/users/graph1.png" name=
filename report "c:/users/test.html";
filename SEND email to ="*****@****.com"
from="****@****.com"
attach=("/C/users/graph1.png" name="testgraph1" inlined="logo1")
content_type="text/html";
ods html file=report;
proc print data=test;
run;
ods html close;
data _null_;
infile report;
file SEND;
input;
put _infile_;
put "<img src='id:logo1'/>";
run;
filename报告“c:/users/test.html”;
文件名发送电子邮件至=“******@****.com”
from=“******@***.com”
attach=(“/C/users/graph1.png”name=“testgraph1”inline=“logo1”)
content_type=“text/html”;
ods html文件=报告;
proc打印数据=测试;
跑
ods html关闭;
数据为空;
填充报告;
文件发送;
输入;
把"填入";;
将“”改为“;
跑
我认为您使用的路径名中有一个错误,这应该更好:
attach=("c:\users\graph1.png")
我在这里还发现了一个例子:
第一部分:
options emailsys = SMTP;
options emailhost = my.smtp.server;
filename myemail EMAIL
to=("TO_ADDRESS@domain.com")
from="FROM NAME <from.name@domain.com>"
sender="FROM NAME <from.name@domain.com>"
/*importance="HIGH"*/
subject = "Subject"
type = "text/html"
attach =(
"fullpath\header.png"
);
ods listing close;
资料来源:
问候,
ods html
body=myemail
options(pagebreak="no")
style=sasweb rs=none;
/* start ods to html with options, rs=none forces ODS to perform record based output */
title;
ods escapechar="^";
ods html text= '<img src="./header.png" alt="header">';
ods html text= "<p>Blah blah blah,</p>";
ods html text= "<p>Blah blah blah blah ^S={font_style=italic}BLAH^S={}..</p>";
ods html text= "<p>blah <a href='www.blah.com' target='_blank'>www.blah.com</a>.</p>";
ods html text= "<p>^S={font_weight=bold}First Lastname^S={}<br>
Division<br>
Company inc.</p>";
ods _all_ close;
...
ods html text = "... next part of my email :";
PROC REPORT DATA=X nowd HEADLINE HEADSKIP
style (report) = {background = white
font_face = "Verdana" font_size = 7pt just=left }
style (column) = {background = white CELLHEIGHT = 2.5%
font_face = "Verdana" font_size = 7pt just=left}
style (header) = {foreground = cx5e2750 font_face="Verdana"
font_size = 8pt just=left
background = white} ;
columns
DATE
TIME
FN
C;
DEFINE DATE / 'Date';
define TIME / 'Time';
define FN / "File Name";
define C / "Run Number";
run;
ods html text = "Have a Great Day.";
...