I'm having trouble sending a test email through Amazon SES using ASP Classic.
- The code for testemail.asp you can find below
- I've added the email address [email protected] to my Amazon SES verified senders list
- I'm using region EU West 1
- Error 80040211 is returned by the Web server as you can see in the IIS log file
- I've included a Wireshark summary of the SMTP session.
- As you can see there is no FROM in the SMTP session, it stops after 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 = "[email protected]"
.From = "[email protected]"
.Subject = "test email"
.TextBody = "test body"
.Send
End With
response.write("sent")
IIS Log file:
#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 output:
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