【问题标题】:how to send a mail in a particular format by using send grid如何使用 sendgrid 以特定格式发送邮件
【发布时间】:2020-07-22 08:41:53
【问题描述】:

我可以使用发送网格 API 发送邮件 如何使用发送网格发送特定格式的邮件

Mail-Format

请找到邮件格式的图片

【问题讨论】:

    标签: azure sendgrid sendgrid-api-v3 sendgrid-templates sendgrid-api-v2


    【解决方案1】:

    将正文作为 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 }
        );
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-23
      • 2016-09-01
      • 2018-11-08
      • 1970-01-01
      相关资源
      最近更新 更多