简体   繁体   English

使用System.Net.Mail smtpclient进行电子邮件格式化

[英]Email formating using System.Net.Mail smtpclient

How do I format the body of the email so it doesn't look so old school :) I've tried sending html through it, but it just comes out as html in the body of the email. 如何设置电子邮件正文的格式,以使它看起来不那么老派:)我尝试通过它发送html,但是它只是在电子邮件正文中以html形式出现。

Thanks for any help and assistance, cheers! 感谢您的帮助和协助,欢呼!

IsBodyHtml属性设置为true。

Including the above, I use StringBuilder's to format the contents of my emails like so: 包括以上内容,我使用StringBuilder's格式化电子邮件的内容,如下所示:

StringBuilder sb = new StringBuilder();
sb.AppendFormat("{0} submitted the following information from the site:", txtName.Text);

I just find it's helpful in visualizing the outcome rather than doing +='s and such. 我只是发现它有助于可视化结果,而不是进行+ =等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM