如何关闭 MailBee.NET SMTP 对象中的 StartTLS
我们使用 critsend 的 SMTP 服务器来发送新闻通讯。将标准 .NET SmtpClient 与 System.Net.NetworkCredential 结合使用是可行的,但我们无法使其与 MailBee 的 SmtpServer 对象一起使用。
以下代码失败,因为服务器回答“服务器不支持 STARTTLS(POP3 的 STLS)命令。”:
SmtpServer smtpServer = new SmtpServer("smtp.critsend.com");
smtpServer.Port = 587;
smtpServer.AccountName = "MY NAME";
smtpServer.Password = "MY PASSWORD";
Smtp.LicenseKey = "MY KEY";
Smtp smtp = new Smtp();
smtp.SmtpServers.Add(smtpServer);
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add("MY EMAIL");
mailMessage.Subject = "Test";
mailMessage.From.Email = "MY EMAIL";
smtp.Message = mailMessage;
smtp.Send();
设置 smtpServer.SslMode = SslStartupMode.Manual 没有帮助。如何关闭 StartTLS?
我们使用的是 MailBee.NET.5.5.2.138。
非常感谢任何帮助。
We are using critsend's SMTP servers for our newsletters. Using the standard .NET SmtpClient with System.Net.NetworkCredential works, but we can't make it work with MailBee's SmtpServer object.
The following code fails because the server answers "The server does not support STARTTLS (STLS for POP3) command.":
SmtpServer smtpServer = new SmtpServer("smtp.critsend.com");
smtpServer.Port = 587;
smtpServer.AccountName = "MY NAME";
smtpServer.Password = "MY PASSWORD";
Smtp.LicenseKey = "MY KEY";
Smtp smtp = new Smtp();
smtp.SmtpServers.Add(smtpServer);
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add("MY EMAIL");
mailMessage.Subject = "Test";
mailMessage.From.Email = "MY EMAIL";
smtp.Message = mailMessage;
smtp.Send();
Setting smtpServer.SslMode = SslStartupMode.Manual doesn't help. How can I turn off StartTLS?
We are using MailBee.NET.5.5.2.138.
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据文档,以下内容应该有效:
According to the docs the following should work:
经过长时间的反复试验,我们终于找到了解决方案。必须将以下属性添加到 SmtpServer:
After long trial and error sessions we finally came up with the solution. The following property has to be added to the SmtpServer: