Godaddy 中的外发电子邮件发送问题 Windows 2012 VPS
Outgoing Email Sending Issue in Godaddy Windows 2012 VPS
我正在尝试从部署在 Godaddy Windows 2012 Vitual Private Server 中的 Web 应用程序发送电子邮件。
显示错误 "Server actively refused the connection"。
从我的本地系统发送电子邮件,但外发电子邮件无法在 Godaddy 主机上运行。
using (var smtp = new SmtpClient()) {
var credential = new NetworkCredential {
UserName = "user@outlook.com",
Password = "password" };
smtp.Credentials = credential;
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
await smtp.SendMailAsync(message);
return RedirectToAction("Sent");
}
首先,尝试添加:
smtp.UseDefaultCredentials = false;
之前:
smtp.Credentials = credential;
自 2016 年 6 月起,Gmail 将其 DMARC 政策从 p="none"
更改为 p="reject"
。
任何使用以 @gmail.com
结尾的发件人地址发送的电子邮件都必须来自 Gmail 的基础架构。
您将需要使用电子邮件发送服务,例如 SendGrid (www.sendgrid.com) or mailgun (www.mailgun.com)。
无论如何您都应该使用其中之一,因为它们可以帮助您远离垃圾邮件黑名单并提供许多其他好处,包括向您显示电子邮件是否因错误的电子邮件地址、垃圾邮件报告等而被阻止的详细信息。
有关 DMARC 是什么及其工作原理的更多信息,请访问 Sendgrid 博客in this article。
我正在尝试从部署在 Godaddy Windows 2012 Vitual Private Server 中的 Web 应用程序发送电子邮件。
显示错误 "Server actively refused the connection"。
从我的本地系统发送电子邮件,但外发电子邮件无法在 Godaddy 主机上运行。
using (var smtp = new SmtpClient()) {
var credential = new NetworkCredential {
UserName = "user@outlook.com",
Password = "password" };
smtp.Credentials = credential;
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
await smtp.SendMailAsync(message);
return RedirectToAction("Sent");
}
首先,尝试添加:
smtp.UseDefaultCredentials = false;
之前:
smtp.Credentials = credential;
自 2016 年 6 月起,Gmail 将其 DMARC 政策从 p="none"
更改为 p="reject"
。
任何使用以 @gmail.com
结尾的发件人地址发送的电子邮件都必须来自 Gmail 的基础架构。
您将需要使用电子邮件发送服务,例如 SendGrid (www.sendgrid.com) or mailgun (www.mailgun.com)。
无论如何您都应该使用其中之一,因为它们可以帮助您远离垃圾邮件黑名单并提供许多其他好处,包括向您显示电子邮件是否因错误的电子邮件地址、垃圾邮件报告等而被阻止的详细信息。
有关 DMARC 是什么及其工作原理的更多信息,请访问 Sendgrid 博客in this article。