通过ASP Classic

时间:2015-11-15 20:25:18

标签: asp-classic

我在使用ASP Classic通过Amazon SES发送测试电子邮件时遇到了问题。

  • 您可以在下面找到testemail.asp的代码
  • 我已将电子邮件地址from@email.com添加到我的Amazon SES验证发件人列表
  • 我正在使用区域EU West 1
  • Web服务器返回错误80040211,如您在IIS日志文件中所见
  • 我已经包含了一个关于SMTP会话的Wireshark摘要。
  • 正如您所看到的,SMTP会话中没有FROM,它会在EHLO
  • 之后停止

testemail.asp

Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

Const cdoSendUsingPort = 2

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort 
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "email-smtp.eu-west-1.amazonaws.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic 
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sendusername"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "sendpassword"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With

With iMsg
Set .Configuration = iConf
.To = "to@email.com"
.From = "from@email.com"
.Subject = "test email"
.TextBody = "test body"
.Send
End With

response.write("sent")

IIS日志文件:

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2015-11-13 14:26:30
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2015-11-13 14:26:30 ip GET /testemail.asp |33|80040211|- 80

Wireshark输出:

SMTP    78  S: 220 Ready to start TLS
SMTP    64  C: STARTTLS
SMTP    161 S: 250 email-smtp.amazonaws.com | 250 8BITMIME | 250 SIZE 10485760 | 250 STARTTLS | 250 AUTH PLAIN LOGIN | 250 Ok
SMTP    75  C: EHLO computername
SMTP    141 S: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-1207622245 BXAQROhZb0x4duTeH4lz

1 个答案:

答案 0 :(得分:0)

它不允许我在上面评论,所以我想把它放在这里。我有一个类似的问题,并禁用了服务器上的Windows防火墙,它的工作原理。几天前我并不需要这样做,但是一旦禁用防火墙,它就像一个魅力。