> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lekalao.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailers

> Wire up SMTP, Amazon SES, Postmark, Mailgun, SendGrid, Brevo or Resend.

Lekalao prepares, personalises and follows the e-mails; a **mailer** hands them to the mailboxes. You keep your own account, your own prices and your own reputation with the provider you choose.

**Settings → Mailers**.

## Add a mailer

**Add a mailer**, then:

### Mailer

A **name** ("SES production") and the **kind**. The form then shows the fields of that kind.

### Credentials

Stored **encrypted** in the database. On a mailer that already exists, a secret already saved shows as "Saved — leave empty to keep it".

| Kind           | Fields                                                                |
| -------------- | --------------------------------------------------------------------- |
| **SMTP**       | Host, port, encryption (STARTTLS, SSL/TLS, none), user, password.     |
| **Amazon SES** | Access key ID, secret access key, region (`eu-west-3`).               |
| **Postmark**   | Server API token, message stream (optional, `broadcast` for example). |
| **Mailgun**    | API key, domain (`mg.example.com`), region (United States or Europe). |
| **SendGrid**   | API key.                                                              |
| **Brevo**      | API key.                                                              |
| **Resend**     | API key.                                                              |

<Tip>
  At the provider, create a key **limited to sending** (and to managing
  webhooks if you want them configured for you), never a key that administers
  the account.
</Tip>

### Feedback

What the provider sends back: deliveries, bounces, complaints. See [Provider feedback](/deliverability/feedback). Depending on the kind, a signing secret field appears (Mailgun, SendGrid, Resend). The **Webhook URL** appears once the mailer is saved.

### Sending rate

The largest number of e-mails per period, written "N e-mails every N seconds": 14 e-mails every 1 second for SES out of its sandbox, say. Leave it empty for no limit. Lekalao keeps to it for campaigns and automations; beyond it, e-mails wait their turn.

## Testing

On a mailer's page, **Test the mailer**: an address, then **Send a test e-mail**. The result appears (**Working**, or **Test failed** with the provider's exact error; **Not tested** before the first attempt) and the date of the last test is kept.

<Warning>
  A mailer that has never passed a test cannot send a campaign: the campaign
  says so in its summary. Test again after every change of credentials.
</Warning>

## A provider per kind of sending

Below the list of mailers, **Mailer per sending type**:

| Setting                   | Serves                                                                                              |
| ------------------------- | --------------------------------------------------------------------------------------------------- |
| **Default mailer**        | Everything with no mailer of its own, and the application's e-mails (invitations, password resets). |
| **Campaigns**             | Campaigns and RSS campaigns.                                                                        |
| **Automations**           | Automation e-mails.                                                                                 |
| **Transactional e-mails** | The API, the Laravel transport and the SMTP relay.                                                  |

"Use the default mailer" leaves the choice to the default.

<Tip>
  Keeping campaigns apart from transactional e-mail protects the ones that
  matter: a campaign that raises complaints does not spoil the reputation of
  the stream that sends the invoices.
</Tip>

## Deleting

At the bottom of a mailer's page, **Delete the mailer**. Its credentials are erased; the sending types that used it fall back to the default mailer.
