CDO.Message.1错误'80040213'和AWS EC2实例

时间:2018-09-12 20:35:04

标签: asp.net amazon-web-services email amazon-ec2 smtp

我的问题与使用.asp开发并在AWS EC2实例上托管的Windows VM上运行的应用程序有关。我正在尝试通过下面的代码通过SMTP发送电子邮件。几天前一切正常,但突然突然停止工作(在工作和崩溃之间未进行任何更改)。在下面,您将找到错误消息和用于发送电子邮件的脚本。关于如何解决该问题(在代码内或在AWS端),我有何建议?

我收到错误消息


CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/includes/ClassDB.asp, line 250

脚本


sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
    smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"
    smtpusername="http://schemas.microsoft.com/cdo/configuration/sendusername"
    smptpassword="http://schemas.microsoft.com/cdo/configuration/sendpassword"
    smtpport="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    smtpauth="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    Set objConfig=CreateObject("CDO.Configuration")
    objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort 
    objConfig.Fields.Item(smtpUrl)="XXX.XX.XX.XXX"
    objConfig.Fields.Item(smtpauth) = cdoBasic
    objConfig.Fields.Item(smtpport) = 25

    objConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/
    smtpusessl") = False

    objConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/
    smtpconnectiontimeout") = 60
    objConfig.Fields.Update

    Set objMail=CreateObject("CDO.Message")
    Set objMail.Configuration=objConfig

    objMail.From = "user@company.com"
    objMail.ReplyTo = replyTo
    objMail.To = mailTo
    objMail.Subject = subject
    'objMail.Bcc = bcc
    objMail.HTMLBody = message
    'objMail.AddAttachment filename_temp
    objMail.Send 
    response.write("mail sent")

0 个答案:

没有答案