[英]Sending emails as company domain from SendGrid
我擁有一個域名example.com。 我想發送來自我的webapp的電子郵件,其中顯示的是來自info@example.com或support@example.com 。
我過去在我的網站中經常使用SendGrid,但我總是能夠通過編輯SendGridMessage
類的From
屬性來填寫電子郵件的SendGridMessage
,它只是在客戶端上顯示出來。
是否有來自sendgrid的官方方式/ API來利用我擁有的域名? 什么阻止我或其他人使用sendgrid API鍵入他們想要的任何域名?
來自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.