我在 SendGrid 的帮助下发送电子邮件。下面是代码。
var client = new SendGridClient(apiKey);
EmailAddress from = new
EmailAddress("a.b@mycompany.com", "Ashutosh");
List<EmailAddress> tos = new List<EmailAddress>
{
new EmailAddress("a.b@mycompany.com",
"Ashutosh"),
};
StringBuilder emailBodyContent = new StringBuilder();
var textContent = "Hi, ";
emailBodyContent.AppendFormat("<p>Hi, </p>");
emailBodyContent.AppendFormat("<p>This is your email.</p>");
var emailSubject = "Attachment names are not unique";
msg = MailHelper.CreateSingleEmailToMultipleRecipients(from,
tos, emailSubject, textContent, emailBodyContent.ToString());
var response = await client.SendEmailAsync(msg);
现在我想发送安全电子邮件。我通过以下链接
https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html
但我不明白如何通过代码设置端口 587 或为发送网格启用安全电子邮件设置。