簡體   English   中英

從SendGrid發送電子郵件作為公司域

[英]Sending emails as company domain from SendGrid

我擁有一個域名example.com。 我想發送來自我的webapp的電子郵件,其中顯示的是來自info@example.comsupport@example.com

我過去在我的網站中經常使用SendGrid,但我總是能夠通過編輯SendGridMessage類的From屬性來填寫電子郵件的SendGridMessage ,它只是在客戶端上顯示出來。

是否有來自sendgrid的官方方式/ API來利用我擁有的域名? 什么阻止我或其他人使用sendgrid API鍵入他們想要的任何域名?

在您的域中設置DNS記錄以允許對您的電子郵件進行身份驗證以及驗證域的所有權的過程在SendGrid中稱為白標 在此過程之后,SPF和DKIM記錄將可用於接收要檢查的服務器。

SPFDKIM確保允許原始IP代表相關域發送電子郵件,並基本上驗證電子郵件的內容未分別被篡改。

阻止其他人從您的域發送的東西稱為DMARC 雅虎,aol和很快谷歌所擁有的域名都實施嚴格的政策; 聲稱來自這些域名但不會發送的電子郵件。 許多其他領域將很快遵循這一趨勢並實施DMARC。

來自https://azure.microsoft.com/en-us/documentation/articles/sendgrid-dotnet-how-to-send-email/的代碼示例演示了如何執行此操作:

// Create the email object first, then add the properties.
var myMessage = new SendGridMessage();

// Add the message properties.
myMessage.From = new MailAddress("john@example.com");

// Add multiple addresses to the To field.
List<String> recipients = new List<String>
{
    @"Jeff Smith <jeff@example.com>",
    @"Anna Lidman <anna@example.com>",
    @"Peter Saddow <peter@example.com>"
};

myMessage.AddTo(recipients);

myMessage.Subject = "Testing the SendGrid Library";

//Add the HTML and Text bodies
myMessage.Html = "<p>Hello World!</p>";
myMessage.Text = "Hello World plain text!";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM