gpt4 book ai didi

sendgrid - 如何使用 C# 将抄送添加到 SendGrid 邮件

转载 作者:行者123 更新时间:2023-12-04 12:18:14 27 4
gpt4 key购买 nike

这是我的代码..

var client = new SendGridClient(SendGridEmailEntity.Key);

var from = new EmailAddress(SendGridEmailEntity.Mail, SendGridEmailEntity.DisplayName);

var subject = templateRecord.EmailFrm.SubjectName;

var to = new EmailAddress(activeQueueEntities[i].EmailId, activeQueueEntities[i].Name);

var plainTextContent = "";

var htmlContent = templateRecord.TemplateContent;
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);

最佳答案

使用下面的代码解决...

var client = new SendGridClient(SendGridEmailEntity.Key);
var from = new EmailAddress(SendGridEmailEntity.Mail, SendGridEmailEntity.DisplayName);
var subject = templateRecord.EmailFrm.SubjectName;
var to = new EmailAddress(activeQueueEntities[i].EmailId, activeQueueEntities[i].Name);
var htmlContent = templateRecord.TemplateContent;

var msg = new SendGridMessage()
{
From = from,
Subject = subject,
HtmlContent = htmlContent,
};

msg.AddTo(to);
msg.AddCcs(CCs);

关于sendgrid - 如何使用 C# 将抄送添加到 SendGrid 邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62949649/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com