To send through Amazon SES over SMTP, you verify a domain or address in the SES region you will use, create SMTP credentials (which are not the same as your IAM access keys), connect to that region's SMTP endpoint on port 587 with STARTTLS or 465 with implicit TLS, and request production access so you can leave the sandbox. Until your account leaves the sandbox you can send only to verified recipients and under tight quotas.
This guide walks through each step in order and points out the mistakes that cause most support requests: using the wrong region, mixing up credentials, and ignoring bounce and complaint handling. Console menus, quotas and approval criteria change, so confirm details in the current AWS documentation.
How SES SMTP is organised
Amazon SES is a regional service. The identity you verify, the sending quotas, the production access status and the SMTP endpoint all belong to one AWS region. If you verify a domain in one region and connect to the endpoint of another, the send fails with an identity error. Choose a region close to your application and use it consistently. The SMTP endpoint has the form email-smtp.REGION.amazonaws.com, for example email-smtp.us-east-1.amazonaws.com. For the general SMTP concepts see SMTP settings, ports and TLS.
Step 1: verify an identity
SES only sends from identities you have verified. You can verify a single email address or an entire domain; the domain route is preferred for production because it covers every address at that domain and enables DKIM signing. When you create a domain identity, SES gives you DNS records to publish, usually CNAME records for Easy DKIM. Add them exactly as shown at your DNS host, and wait until the console shows the identity as verified. Also publish SPF and DMARC for the domain; see authenticating your sending domain. Consider configuring a custom MAIL FROM domain so that the return path aligns with your domain, as explained in custom return-path domains.
Step 2: create SMTP credentials
SMTP credentials are generated from an IAM user that has permission to send mail with SES. In the SES console, the SMTP settings page has a button to create SMTP credentials, which creates an IAM user and shows the SMTP username and password once. Save them immediately in a secret manager. The SMTP username is the IAM access key ID. The SMTP password is not the IAM secret access key; it is derived from it, and the derivation is specific to the region. Using the secret access key directly as the password will fail authentication.
If you manage IAM yourself, you can derive the SMTP password from an existing secret key with a small script. AWS documents the algorithm; the following reproduces the documented version 4 method, but verify it against the current documentation before relying on it in automation.
import base64, hashlib, hmac, sys
def sign(key, msg):
return hmac.new(key, msg.encode('utf-8'), hashlib.sha256).digest()
def smtp_password(secret_access_key, region):
sig = sign(('AWS4' + secret_access_key).encode('utf-8'), '11111111')
sig = sign(sig, region)
sig = sign(sig, 'ses')
sig = sign(sig, 'aws4_request')
sig = sign(sig, 'SendRawEmail')
return base64.b64encode(bytes([0x04]) + sig).decode('utf-8')
if __name__ == '__main__':
print(smtp_password(sys.argv[1], sys.argv[2]))Scope the IAM policy to the minimum action needed (sending email) and, where possible, to specific identities. Rotate credentials periodically, in line with the habits in API key security and rotation.
Step 3: connect and send
| Setting | Value |
|---|---|
| Host | email-smtp.REGION.amazonaws.com |
| Port with STARTTLS | 587 (also 25 and 2587; port 25 is frequently blocked by hosts) |
| Port with implicit TLS | 465 (also 2465) |
| Username | SMTP username created in the console |
| Password | SMTP password created in the console |
| From address | An address on a verified identity |
# Test the connection and TLS
openssl s_client -starttls smtp -connect email-smtp.us-east-1.amazonaws.com:587 -crlf
# Send a message with swaks
swaks --server email-smtp.us-east-1.amazonaws.com:587 --tls \
--auth LOGIN --auth-user "$SES_SMTP_USER" --auth-password "$SES_SMTP_PASS" \
--from [email protected] --to [email protected]For more on connection testing, see testing SMTP from the command line.
Understanding the sandbox
New SES accounts start in the sandbox in each region. In the sandbox, you can send only to verified addresses and domains (and to the SES mailbox simulator), the daily quota is small and the sending rate is low. The exact numbers are shown in the console and can change, so read them there instead of relying on a blog post. The sandbox exists to protect the shared reputation of the service, which is also why moving out requires a short request.
Step 4: request production access
In the SES console, request production access for the region you use. The request form asks about your website, the type of mail you send, how you collect addresses, how you handle bounces and complaints, and your expected volume. Answer honestly and specifically. Reviewers look for evidence that you send wanted mail and process feedback.
- Describe the mail type: transactional, such as receipts and password resets, or marketing, and how recipients opted in.
- Explain how you will handle bounces and complaints, for example by subscribing to notifications and suppressing addresses automatically.
- Include your unsubscribe process for any marketing mail.
- State realistic daily volume and peak rate.
- Make sure your website and domain look legitimate and match the stated use case.
- Repeat the request for each region you intend to use.
Approval is at AWS's discretion and timelines vary. Do not purchase lists or send test blasts while waiting.
Handle bounces and complaints from day one
SES monitors your bounce and complaint rates and can place an account under review or pause sending if they stay high. Configure event publishing or notifications for bounces and complaints, and automatically suppress affected addresses. Learn the difference in bounce classification and keep your rates low with complaint rate guidance. Do not assume the account-level suppression list replaces your own; maintain your application's suppression logic as well.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| 535 Authentication Credentials Invalid | Used IAM secret key as password, or wrong region | Use the generated SMTP password for that region |
| 554 Message rejected: Email address is not verified | Sender or, in the sandbox, recipient is not verified | Verify the identity in the same region |
| Connection timeout | Port blocked by network | Use 587 or 465, or 2587 or 2465 if your host blocks the standard ones |
| Throttling or maximum sending rate exceeded | Exceeded per-second rate | Add retries with backoff; request higher limits |
| Daily sending quota exceeded | Reached the quota | Wait or request an increase |
| Messages go to spam | Missing DKIM, SPF alignment or DMARC; poor list quality | Complete authentication and clean the list |
| Domain still pending | DNS record not published correctly | Recheck the DKIM CNAME names and values |
Alternatives and next steps
SES is low cost and flexible, and it expects you to build monitoring, suppression and reporting yourself. If you would rather get those features included, compare options in Amazon SES alternatives. Whichever route you choose, authenticate your domain, handle feedback automatically and warm up new volume gradually.
Operating SES in production
After approval, watch your sending statistics and reputation metrics in the console and keep your bounce and complaint rates well below the levels at which AWS reviews accounts. Ramp volume gradually on a new domain rather than sending your whole list on day one, and keep transactional and marketing mail on separate identities or configuration sets so that a marketing problem does not affect receipts and password resets.
Store SMTP credentials in a secret manager, give each application its own IAM user so you can revoke one without breaking others, and alert on authentication failures, which usually indicate a rotated or leaked credential. Regional redundancy is possible but requires verifying identities, credentials and production access in a second region, and deciding in your application how to fail over. Document these choices so on-call engineers know what to do when sending fails.
Prefer a relay with built-in event handling? Use MigoSMTP for SMTP on 587 or 465 with webhooks and automatic suppression of hard bounces and complaints.
References and further reading
Frequently asked questions
Are SES SMTP credentials the same as my AWS access keys?
No. The SMTP username is the IAM access key ID, but the SMTP password is derived from the secret key for a specific region and must be generated as documented.
What can I do in the SES sandbox?
You can send only to verified addresses or domains, within low quotas and rates, until you are granted production access in that region.
Which port should I use with SES SMTP?
Use 587 with STARTTLS or 465 with implicit TLS. Ports 2587 and 2465 are alternatives if your network blocks the standard ports.
Do I need production access for each region?
Yes. Identities, quotas and production status are per region, so repeat verification and the access request for every region you use.
Why does SES reject my message as unverified?
The From address or domain is not a verified identity in the region you connected to, or you are in the sandbox and the recipient is not verified.