[英]How to send emails with List<string>() using Send Grid mvc azure
[英]how to send a mail in a particular format by using send grid
將正文作為 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 }
);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.