【发布时间】:2020-07-22 08:41:53
【问题描述】:
【问题讨论】:
标签: azure sendgrid sendgrid-api-v3 sendgrid-templates sendgrid-api-v2
【问题讨论】:
标签: azure sendgrid sendgrid-api-v3 sendgrid-templates sendgrid-api-v2
将正文作为 HTML 传递并设置 IsBodyHtml = true。我使用 SendGrid 执行此操作。
public Task SendEmailAsync(string email, string subject, string htmlMessage)
{
var client = new SmtpClient(host, port)
{
Credentials = new NetworkCredential(userName, password),
EnableSsl = false
};
return client.SendMailAsync(
new MailMessage(from, email, subject, htmlMessage) { IsBodyHtml = true }
);
}
【讨论】: