# Mailpiece with Amazon SES

*Send your newsletter through Amazon SES, from your own AWS account.*

Mailpiece sends every issue through Amazon SES's SMTP interface, from your own domain and AWS account.

## What you get

- Issues, test issues, welcome emails and confirmations
- Any AWS Region with an SES SMTP endpoint
- Each newsletter's own from name, from address and reply-to
- The app's sign-in mail through the same SES account
- Prefer its API? [Send through a relay](https://mailpiece.dev/docs/relay).

## Set up SES

In one Region with an SMTP endpoint: create a domain identity with Easy DKIM and publish its three CNAME records, request production access (Marketing) from the Account dashboard, and under SMTP settings choose Create SMTP credentials. Copy the username and password: they are shown once, and are not your AWS secret access key.

A new SES account starts in the sandbox: it sends only to verified addresses, 200 messages a day and one a second, until AWS grants production access.

## Set the outgoing mail

On Settings › Outgoing mail, set up an SMTP server: the Server is `email-smtp.<region>.amazonaws.com`, the Port `587`, and the Username and Password your SES SMTP credentials. Port `587` uses STARTTLS; port `465` is TLS from the first byte. Keep `MAIL_DELIVERIES_PER_MINUTE` (`30` in the shipped deploy file) within your SES sending rate. Every setting is in the [mail guide](https://mailpiece.dev/docs/mail).

```sh
# Or from the CLI, with your Region
mailpiece settings sending smtp update --address email-smtp.eu-west-1.amazonaws.com --port 587 \
  --username ... --password ...

# In the server's environment
MAIL_DELIVERIES_PER_MINUTE=30

# The app's sign-in mail, optional
SMTP_ADDRESS=email-smtp.eu-west-1.amazonaws.com
SMTP_USERNAME=...
SMTP_PASSWORD=...
# on your verified domain
MAILER_FROM_ADDRESS=...
```

## Send a test issue

Set a from address on your verified domain in Settings › Sending and send a test issue from any post. In the sandbox, send it to an address verified in SES.

## Set it up this afternoon

Install Mailpiece on a server, connect Amazon SES, and send your next issue. [Install Mailpiece](https://mailpiece.dev/docs/install)
