[英]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.