[英]How to send secure email through Send Grid?
我正在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或啟用發送網格的安全電子郵件設置。
如果您使用的是SendGrid v3 API ,則完全不必擔心SMTP。 您只需調用Web API即可發送電子郵件。 所有呼叫均為HTTPS。
退房的源代碼 ,請注意HTTP 秒 。
private void InitiateClient(string apiKey, string host, ...)
{
...
var baseAddress = host ?? "https://api.sendgrid.com";
...
我還在下面的網址中找到該網址,該網址表示默認情況下,SendGrid使用TLS。
https://sendgrid.com/blog/sendgrid-and-the-future-of-email-security/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.