Classic ASP
Classic ASP
Amazon SES SMTP: Send email over implicit TLS on port 465
See more Amazon SES Examples
Connect to the regional SES SMTP endpoint with TLS from the start of the connection. Load the SMTP username and password from protected application configuration. SES SMTP passwords are Region-specific and differ from AWS secret access keys used to sign API requests. Replace the From address with a verified sender. The example delivers to the SES mailbox simulator.
TLS connections to SES SMTP · Obtain SMTP credentials
Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
' Assumes Chilkat is unlocked. See Global Unlock Sample.
success = 0
set mail = Server.CreateObject("Chilkat.MailMan")
' Use the SMTP endpoint and SMTP credentials issued for the same AWS Region.
mail.SmtpHost = "email-smtp.us-west-2.amazonaws.com"
mail.SmtpPort = 465
mail.SmtpSsl = 1
mail.RequireSslCertVerify = 1
mail.SmtpUsername = "SES_SMTP_USERNAME"
mail.SmtpPassword = "SES_SMTP_PASSWORD"
set email = Server.CreateObject("Chilkat.Email")
email.From = "sender+reports@example.com"
email.Subject = "SES SMTP connection test"
email.Body = "This message was submitted over implicit TLS on port 465."
success = email.AddTo("SES mailbox simulator","success@simulator.amazonses.com")
If (success <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( email.LastErrorText) & "</pre>"
Response.End
End If
success = mail.SendEmail(email)
If (success <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( mail.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( "SES accepted the message over SMTP.") & "</pre>"
success = mail.CloseSmtpConnection()
If (success <> 1) Then
' The server already accepted the message. Retrying here could send a duplicate.
Response.Write "<pre>" & Server.HTMLEncode( "The SMTP connection did not close cleanly.") & "</pre>"
End If
%>
</body>
</html>