【发布时间】:2017-10-14 11:31:21
【问题描述】:
我正在调用一个在我的 asp.net mvc 项目中发送电子邮件的函数,我希望正文能够格式化为 html
这是我发送电子邮件的功能:
private void EnvoieCourriel(string adrCourriel, string text, string object, string envoyeur, Attachment atache)
{
SmtpClient smtp = new SmtpClient();
MailMessage msg = new MailMessage
{
From = new MailAddress(envoyeur),
Subject = object,
Body = text,
};
if (atache != null)
msg.Attachments.Add(atache);
msg.To.Add(adrCourriel);
smtp.Send(msg);
return;
}
电子邮件已发送,它的作用就像一个魅力,但它只显示纯 html,所以我想知道我的 MailMessage 实例中的一个论点
【问题讨论】:
标签: c# html asp.net-mvc email