Sending email using Amazon SES with Classic ASP

John Avis by | March 21, 2017 | Classic ASP Web Development

I recently needed to change a client's website to send emails using Amazon SES and encountered a few issues.
I recently needed to change a client's website to send emails using Amazon SES and encountered a few issues.

The client's code was using jMail COM component but I couldn't make this work, most likely because Amazon SES requires use of TLS and I could not find how to enable this in jMail, if it supports it at all.

So the solution was to change to CDOSYS, but this required some experimentation before it would work.

Some of the errors I received along the way were:

• The server rejected the sender address
• The server response was: 530 Authentication required
• 530 Must issue a STARTTLS command first

To use CDOSYS with Amazon SES you must specify a remote server, authenticate using basic authentication, use port 25, and use SSL (not TLS as I attempted).

This sample code worked for me. You will of course need to include your own Amazon SES SMTP login details, server name, and verified sender address.

Dim objMessage
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Your subject"
objMessage.From = ""
objMessage.Configuration.Fields.Item("") = 2
objMessage.Configuration.Fields.Item("") = "" 'Change if using a different Amazon SES server
objMessage.Configuration.Fields.Item("") = 1
objMessage.Configuration.Fields.Item("") = "Your Amazon SES SMTP username, usually starts with AKI..."
objMessage.Configuration.Fields.Item("") = "Your Amazon SES SMTP password"
objMessage.Configuration.Fields.Item("") = 25
objMessage.Configuration.Fields.Item("") = True
objMessage.TextBody = "This is a test email"
objMessage.To = ""

On Error Resume Next

If Err.Number = 0 Then
Response.Write("FAIL: " + Err.Description)
End If

Related Posts

Intermittent "Unable to read data from the transport connection: net_io_connectionclosed" errors

by John Avis | May 6, 2020

If you are having intermittent problems sending email in .NET using System.Net.Mail consider switching libraries.

500 Internal Server Error after migrating from IIS 7.5 to IIS 10

by John Avis | November 4, 2019

As support ends for Microsoft Windows Server 2008 I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10 but some of the websites did not work.

tagInput: A simple jQuery plugin for tag entry using Bootstrap 4

by John Avis | October 15, 2019

For a website project I needed a way to enter multiple tags. I just wanted something simple that I could easily modify to suit my own needs, so I wrote my own.


There are no comments yet. Be the first to leave a comment!

Leave a Comment



...random postings about web development and programming, Internet, computers and electronics topics.

I recommend ASPnix for web hosting and Crazy Domains for domain registration.


Get the latest posts delivered to your inbox.