【发布时间】:2015-04-26 23:45:24
【问题描述】:
我正在尝试使用 SendGrid 库发送电子邮件:https://github.com/sendgrid/sendgrid-csharp
更具体地说,我正在这样做......
// Create the email object first, then add the properties.
SendGridMessage myMessage = new SendGridMessage();
myMessage.AddTo("anna@example.com");
myMessage.From = new MailAddress("john@example.com", "John Smith");
myMessage.Subject = "Testing the SendGrid Library";
myMessage.Text = "Hello World!";
// Create credentials, specifying your user name and password.
var credentials = new NetworkCredential("username", "password");
// Create an Web transport for sending email.
var transportWeb = new Web(credentials);
// Send the email.
transportWeb.DeliverAsync(myMessage);
代码运行良好,但我从未收到电子邮件!如何诊断此问题?
请注意,电子邮件不会出现在退回/阻止/垃圾邮件报告或无效电子邮件列表中。
【问题讨论】:
-
不应该是
await transportWeb.DeliverAsync(myMessage); -
您是否在电子邮件活动报告中看到已处理的事件?