Myk*_*nko 3 email vbscript cdo.message
发送电子邮件时出错:"错误'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
Run Code Online (Sandbox Code Playgroud)
有人遇到过类似的问题吗?
迟到的回复,但我想我会分享我在处理同样问题时学到的东西.
从我读到的错误80040211基本上意味着你的SMTP服务返回不成功.如果您确定您的服务已启动并且您可以远程登录,那么您的解决方案可能会通过查看smtp服务器设置而不是您的代码来解决.
在我的情况下,当我尝试附加文件时,我收到此错误.原来邮件大小的默认限制只有2MB.当我在IIS的SMTP设置中增加此限制时,一切都开始正常工作.