我在使用ASP Classic通过Amazon SES发送测试电子邮件时遇到了问题。
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
答案 0 :(得分:0)
它不允许我在上面评论,所以我想把它放在这里。我有一个类似的问题,并禁用了服务器上的Windows防火墙,它的工作原理。几天前我并不需要这样做,但是一旦禁用防火墙,它就像一个魅力。