指引网

当前位置: 主页 > 编程开发 > ASP >

Jmail发送附件

来源:网络 作者:佚名 点击: 时间:2017-06-22 20:44
[摘要] 用Jmail发送附件: jmail.Body=this is a file from jmail using c# asp.net; jmail.AddAttachment(Server.MapPath(01.jpg),false,image/jpg); 发送HTML: jmail.HTMLBody=hrthis is htmlbr; 如果HTML内容中含有图像等连接,可以:
用Jmail发送附件:
jmail.Body="this is a file from jmail using c# asp.net";
jmail.AddAttachment(Server.MapPath("01.jpg"),false,"image/jpg");
发送HTML:
jmail.HTMLBody="<hr>this is html<br>";
如果HTML内容中含有图像等连接,可以:
1)
jmail.HTMLBody="<hr>this is html<br><img src=http://www.image.com/img.gif'>";
2)
string cid=jmail.AddAttachment(Server.MapPath("01.jpg"),true,"image/jpg");
jmail.HTMLBody="<hr>this is html<br><img src='cid:"+cid+"'>";

------分隔线----------------------------