0
设置: 我有一个带有API的电子邮件服务。我的其他应用程序连接到API,提供一个电子邮件对象。电子邮件服务然后发送电子邮件。我已经在几个应用程序中使用它,并且它的工作完美无瑕。无法解析SMTP远程名称
现在我正在实施它到一个旧的桌面应用程序。问题:
我想从office365发送一封电子邮件。这工作50%的时间。另外50%,我得到一个SMTP异常说:“远程名称无法解析:'smtp.outlook.office365.com'GeneralFailure”。
我试过使用smtp.office365.com作为删除服务器,它仍然失败,每隔一段时间。
该应用程序正确连接到API,我可以尽可能发送电子邮件。而且经常发生上述异常。
SmtpClient SmtpServer = new SmtpClient(creds.SmtpServer);
SmtpServer.UseDefaultCredentials = false;
SmtpServer.Port = (int)creds.SmtpPort;
SmtpServer.Credentials = new System.Net.NetworkCredential(creds.Account, creds.Password);
SmtpServer.EnableSsl = true;
using (SmtpServer)
{
SmtpServer.Send(mail);
dbLayer.LoggEmail(email, false, null);
return true;
}
是否有任何想法,想法或答案?它奇怪它有效有时。
感谢您的帮助。我想这可能是原因。 – fjompen