Jmail发送附件

80酷酷网    80kuku.com

  jmail用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
";

如果HTML内容中含有图像等连接,可以:

1)

jmail.HTMLBody="<hr>this is html
<img src=/uploadpic/2007-2/200725181820218.gif'>";

2)

string cid=jmail.AddAttachment(Server.MapPath("01.jpg"),true,"image/jpg");

jmail.HTMLBody="<hr>this is html
<img src='cid:"+cid+"'>";


分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: