是否有一些技巧使VBScript CDO与Amazon SES SMTP协同工作?我没有收到任何错误,但它也没有发送给我我的测试电子邮件.将SSL更改为False确实给我530错误,所以我知道我至少到达了服务器.我究竟做错了什么?
EmailSubject = "Sending Email by CDO" EmailBody = "This is the body of a message sent via" & vbCRLF & _ "a cdo.message object using SMTP authentication." Const EmailFrom = "[email protected]" Const EmailFromName = "Me Test" Const EmailTo = "[email protected]" Const SMTPServer = "email-smtp.us-east-1.amazonaws.com" Const SMTPlogon = "xxxxxx" Const SMTPPassword = "xxxxxxx" Const SMTPSSL = True Const SMTPPort = 25 Const cdoSendUsingPickup = 1 'Send message using local SMTP service pickup directory. Const cdoSendUsingPort = 2 'Send the message using SMTP over TCP/IP networking. Const cdoAnonymous = 0 ' No authentication Const cdobasic = 1 ' BASIC clear text authentication Const cdoNTLM = 2 ' NTLM,Microsoft proprietary authentication ' First,create the message Set objMessage = CreateObject("cdo.message") objMessage.Subject = EmailSubject objMessage.From = """" & EmailFromName & """ <" & EmailFrom & ">" objMessage.To = EmailTo objMessage.TextBody = EmailBody ' Second,configure the server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdobasic objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPlogon objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objMessage.Configuration.Fields.Update ' Now send the message! objMessage.Send
解决方法
CDO不支持TLS,但仅支持SSL. AWS SES将允许您通过TCP端口465使用SSL.尝试在端口25上使用SSL,就像您在发布的脚本中使用SSL一样,应该返回以下错误消息:
cdo.message.1:传输失去了与服务器的连接.
我不知道你为什么不用这个脚本得到那个错误.我做.尝试将端口更改为465.当我将端口更改为465时,它可以正常工作.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。