【问题标题】:VBScript Error '80040211' when sending emails发送电子邮件时出现 VBScript 错误“80040211”
【发布时间】:2014-06-07 03:00:26
【问题描述】:

发送电子邮件时出现错误: “错误‘80040211’”

这是我的代码示例-

Dim objMessage
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Super Service Comment - "

objMessage.From = "someone@s.com"
objMessage.To = "someone1@s.zendesk.com;someone2@s.com"
objMessage.TextBody = "Name...."

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com" 'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "someone4@s.com" 'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "******" 'Your password on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'Server port (typically 25)  
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true 'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Update      
objMessage.Send 

有人遇到过类似的问题吗?

【问题讨论】:

标签: email vbscript cdo.message


【解决方案1】:

我将添加另一个原因:登录 SMTP 服务器时用户名或密码不正确。

【讨论】:

    【解决方案2】:

    更晚的答案(以防他人使用)。当我们没有在我们的 Exchange 盒子上配置连接器时,我们收到了这个错误。

    【讨论】:

      【解决方案3】:

      回复也很晚,但这里的信息可能对某人很有价值。事实证明,在我的情况下,一般错误80040211 是由行长度超过服务器允许的限制引起的。就我而言,有时将vbcrlf 作为回车/换行添加到电子邮件正文可以解决问题。

      【讨论】:

        【解决方案4】:

        我遇到了同样的错误,所以我配置了我的 Gmail 设置,激活了两步验证并创建了一个新的应用程序密码,仅用于 CDOsys。它就像一个魅力。

        【讨论】:

          【解决方案5】:

          回复晚了,但我想我会分享我在处理同一问题时所学到的知识。

          从我读到的错误80040211 基本上意味着您的 SMTP 服务返回不成功。如果您确定您的服务已启动并且您可以 telnet 进入它,那么您的解决方案可能会通过查看 smtp 服务器设置而不是您的代码来解决。

          就我而言,我在尝试附加文件时遇到此错误。原来消息大小的默认限制仅为 2MB。当我在 IIS 的 SMTP 设置中增加此限制时,一切都开始正常工作了。

          【讨论】:

          • 您好,能否附上一个简短的示例或任何图片?
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2013-11-24
          • 1970-01-01
          • 2015-02-15
          • 1970-01-01
          • 1970-01-01
          • 2012-08-23
          • 1970-01-01
          相关资源
          最近更新 更多