我正在尝试发送带有sendgrid的电子邮件,但它不想发送出去。 我正在使用的代码
public bool SendMessage<T>(ISendGridTemplateData<T> templateData, string subject, string body) where T: ISendGridTemplateSubstitutions
{
try
{
var client = new SendGridClient("APIKWY");
var FromE = new EmailAddress(From);
var Subject = subject;
var toe = new EmailAddress("MYEMAIL");
var plainTextContent = body;
var htmlContent = "";
var msg = MailHelper.CreateSingleEmail(FromE, toe, subject, plainTextContent, htmlContent);
var response = client.SendEmailAsync(msg);
它运行并提取所有电子邮件详细信息,但不发送出去,不确定我丢失了什么。