jmail发送html格式的邮件

  jmail发送邮件非常的方便,但是发送的邮件在收件箱中无任何格式,本文中将向您介绍添加html格式的方法。

前台页面.aspx 添加一个div和一个label,Label的内容在Page_Load中调用构造函数生成。

 <div align="left" style="width:920px;height:350px;border:solid 1px gray;overflow-y:auto">
                    <asp:Label ID="lbl_content" runat="server" Width="900px"></asp:Label>                        
   </div>

 

后台页面.cs

 protected void Create_MailBody(string mailto,string mailfrom)
    {
        string mailbody = "<html><body>"+mailto + ",";
        mailbody += "<p>&nbsp;&nbsp;Thanks again for granting us the project. We are in the process of lunching he project. We well need your help to confirm or provide the following information.</p>";
        mailbody += "<p>&nbsp;&nbsp;1. Please confirm that the CAD files as in quote are latest if not please email us the latest. Please also point out the changes between quoted file and latest files.</p>";
        mailbody += "<p>&nbsp;&nbsp;2. Please provide 2D files with tolerances and critical dimensions for our quality control purpose.</p>";
        mailbody += "<p>&nbsp;&nbsp;3. Please provide an assembly file if these parts are assembled together.</p>";
        mailbody += "<p>&nbsp;&nbsp;4. Please provide the mating part drawings if these parts will be assembled the other parts. Or please provide us real samples of mating part. We will try the fitiness before shipping.</p>";
        mailbody += "<p>&nbsp;&nbsp;We have setup a project website for this project. You may login to view the project team, project launch info and project status.</p>";
        mailbody += "<p>&nbsp;&nbsp;Please let us know if you have any questions.</p>";
        mailbody += "<p>&nbsp;&nbsp;Best Regards.</p>";
        mailbody += "<p>&nbsp;&nbsp;" + mailfrom + "<br>";
        mailbody += "&nbsp;&nbsp;ICOMold<br>&nbsp;&nbsp;6415 Angle RD<br>&nbsp;&nbsp;<a href='http://www.icomold.com'>http://www.icomold.com</a></p></body></html>";
       
        lbl_content.Text = mailbody;
    }

这样发送到邮箱后就会按照html格式显示,效果如上图所示。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值