如何自定义System.Net.Mail.MailMessage 中Body?
如何自定义System.Net.Mail.MailMessage 中Body?使邮件内容更友好 --------------------编程问答-------------------- 什么意思?怎么个友好法? --------------------编程问答-------------------- 意思是在编写邮件正文的时候,如何显示段落、URL等。。。我不懂如何丰富Body的内容,只能返回字符串。。。public void SendSMTPEMail(string strSmtpServer, string strFrom, string strFromPass, string strto, string strSubject, string strBody)
{
SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(strFrom, strFromPass);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
MailMessage message = new System.Net.Mail.MailMessage(strFrom, strto, strSubject, strBody);
message.From = "Administrator@163.com.cn";
message.To = "yuanhui630@163.com";
message.Subject = "测试";
message.Body = "邮件正文";
//Attachment attachment = new System.Net.Mail.Attachment("c:\\log.log");
//message.Attachments.Add(attachment);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
}
补充:.NET技术 , ASP.NET