发送电子邮件时VBScript错误'80040211' [英] VBScript Error '80040211' when sending emails
问题描述
发送电子邮件时出现错误:
错误'80040211'
I have an error when sending emails: "error '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
有人处理过类似的问题吗?
Someone worked with a similar problem?
推荐答案
最近答复,但想出我愿意分享的内容我已经学会了处理相同的问题。
Late reply, but figured I'd share what I've learned in dealing with the same issue.
从我读到的错误中, 80040211
基本上意味着您的SMTP服务返回失败。如果您确定服务已启动并且可以远程登录到该服务,则可以通过查看smtp服务器设置而不是代码来解决您的解决方案。
From what I've read error 80040211
basically means your SMTP service is returning not successful. If you're sure your service is up and you can telnet into it then your solution will probably be solved by looking at the smtp server settings, not your code.
在我的情况是我尝试附加文件时遇到此错误。原来,邮件大小的默认限制仅为2MB。当我在IIS的SMTP设置中增加此限制时,一切都开始正常工作。
In my case I was getting this error when I was trying to attach a file. Turns out the default limit for message size is only 2MB. When I increased this limit in IIS's SMTP setup everything started working just fine.
这篇关于发送电子邮件时VBScript错误'80040211'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!