所有常见电子邮件提供商均阻止 SMTP 访问(CDO / VBScript)

发布于 2025-01-12 05:01:34 字数 1931 浏览 0 评论 0原文

直到最近至少 10 年里, 我已经成功通过 SMTP 发送电子邮件, 通过使用带有 CDO.Message 的简单 VBScript。

Set emailObj      = CreateObject("CDO.Message")
emailObj.From     = "[email protected]>"
emailObj.To       = "[email protected]"
emailObj.Subject  = "Test Email"
emailObj.TextBody = "This is a SMTP test email."

Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-mail.outlook.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
emailConfig.Fields.Update
emailObj.Send

然而,通过新的测试,我注意到广泛使用的电子邮件提供商(Yahoo、GMail、Hotmail、Mail.com、Yandex)的 SMTP 不再起作用。

对于所有这些,我收到错误消息:

传输无法连接到服务器

为了确保这不是我的问题,我在许多计算机、国家/地区和帐户上进行了测试。我一直在使用官方提供的 SMTP 详细信息和端口 25、465、587 进行测试。其中任何一个都没有运气。

该代码仍然可以成功地与我自己公司的 SMTP 和我们的虚拟主机 SMTP 配合使用。

我们将软件分发给客户,并且不希望他们依赖我们自己的 SMTP 来转发邮件。 他们应该能够在我们的软件上轻松设置他们的个人电子邮件帐户。过去,只需检查他们自己的电子邮件提供商网站并输入提供的 SMTP 详细信息即可。 然而,如今这样的琐碎任务似乎已经变得不可能了。

我在这里遗漏了什么吗?是否仍然可以使用 Visual Basic 脚本和 CDO 来使用广泛使用的电子邮件提供商的 SMTP?

For at least 10 years until recently,
I've been successfully sending emails through SMTP,
by using a simple VBScript with CDO.Message.

Set emailObj      = CreateObject("CDO.Message")
emailObj.From     = "[email protected]>"
emailObj.To       = "[email protected]"
emailObj.Subject  = "Test Email"
emailObj.TextBody = "This is a SMTP test email."

Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-mail.outlook.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
emailConfig.Fields.Update
emailObj.Send

However with a new test, I notice that no SMTP of widely used email providers works anymore (Yahoo, GMail, Hotmail, Mail.com, Yandex).

For all of them I get the error message:

The transport failed to connect to the server

To be sure it wasn't a problem from my end, I tested from many computers, countries and accounts. I've been testing with the officially provided SMTP details and ports 25, 465, 587. No luck with any of them.

The code still works successfully with the SMTP of my own company and our webhosting SMTP.

We distribute the software to our customers, and we don't want them to be dependent on our own SMTP to relay their mail.
They should be able to easily setup their personal email accounts on our software. It used to be as easy as checking their own email provider website and entering the provided SMTP details.
However, nowadays such a trivial tasks seems to have become impossible.

Am I missing something here, is it still possible to use the SMTP of widely used email providers using Visual Basic Script and CDO?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月朦胧 2025-01-19 05:01:34

以下是常见电子邮件提供商及其方法的列表。

我只是不明白 VBScript 如何在 10 行代码中做到这一点。

  • MAILTRAP - 显式 TLS 连接 (STARTTLS)
  • GMAIL - 隐式 TLS 连接 (SSL)
  • iCLOUD - 显式 TLS 连接 (STARTTLS)
  • OUTLOOK - 显式 TLS 连接 (STARTTLS)
  • YAHOO.COM - 显式 TLS 连接 (STARTTLS)
  • MAIL.COM - 显式 TLS 连接 ( STARTTLS)
  • AOL.COM - 显式 TLS 连接 (STARTTLS)
  • COMCAST.NET - 显式 TLS 连接 (STARTTLS)

Here is a list of common email providers and their methods.

I just don't see how VBScript can do this in 10 lines of code.

  • MAILTRAP - EXPLICIT TLS connection (STARTTLS)
  • GMAIL - IMPLICIT TLS connection (SSL)
  • iCLOUD - EXPLICIT TLS connection (STARTTLS)
  • OUTLOOK - EXPLICIT TLS connection (STARTTLS)
  • YAHOO.COM - EXPLICIT TLS connection (STARTTLS)
  • MAIL.COM - EXPLICIT TLS connection (STARTTLS)
  • AOL.COM - EXPLICIT TLS connection (STARTTLS)
  • COMCAST.NET - EXPLICIT TLS connection (STARTTLS)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文