# Custom SMTP

> Send a SupaHost project's Auth emails through your own SMTP provider (Amazon SES, Mailgun, Postmark, SendGrid, Brevo, Resend) from your own domain, and set the email rate limits.

Source: https://supahost.app/docs/auth/smtp · Updated 2026-11-11

By default, SupaHost sends your project's Auth emails for you. They come from `noreply@supahost.app`, through SupaHost's email provider (Resend), and Auth sends at most 30 of them an hour. That's fine while you build. For production, you'll usually want emails to come from your own domain, with a higher limit. Custom SMTP does that: Auth sends every email through your own provider account.

Custom SMTP covers every email Auth sends: sign-up confirmations, magic links and email codes, password resets, invites and email change confirmations. The wording still comes from your templates on the **Auth emails** card. See [Auth emails and templates](/docs/auth/email-templates).

## Before you start

You need an account with an email provider that offers SMTP. Amazon SES, Mailgun, Postmark, SendGrid, Brevo and Resend all work, as does any other provider with standard SMTP.

In the provider's console:

1. Verify the domain you want to send from, such as `example.com`. The provider gives you DNS records (SPF, DKIM and often a return-path record) to add at your DNS host.
2. Create SMTP credentials. Some providers use your account login, some generate a separate SMTP username and password, and some use an API key as the password.
3. Note the SMTP host and port.

The sender address must be on a domain the provider has verified, or the provider will reject the emails.

## Set it up

Open *Dashboard → your project → **Auth** tab → **SMTP settings***, switch on **Use custom SMTP**, and fill in:

| Field | What to enter |
|---|---|
| Sender email | The From address, such as `no-reply@example.com`. Its domain must be verified with the provider |
| Sender name | The name recipients see. Leave it empty to use the **App name** from the **Auth** card |
| Host | The provider's SMTP hostname, such as `smtp.eu.mailgun.org`. It must be a public hostname |
| Port | `25`, `465`, `587`, `2465` or `2587`. Port 465 uses TLS from the start; 587 starts plain and upgrades with STARTTLS |
| Username | The SMTP username from the provider |
| Password | The SMTP password or API key. Stored encrypted and never shown again. Leave it empty later to keep the saved one |
| Minimum gap per user | Seconds before the same user can be sent another email (0 to 3600, default 60) |
| Emails per hour | The project-wide limit on Auth emails (1 to 10000, default 100) |

Click **Save SMTP settings**. The change reaches your project within about a minute. Only the instance owner can change these settings; team members see them read-only.

To go back to SupaHost's email, switch **Use custom SMTP** off and save. Emails then come from `noreply@supahost.app` again, limited to 30 an hour.

## Common provider settings

These are typical values. Check your provider's console for the exact host, which often depends on your account's region.

| Provider | Host | Port | Username |
|---|---|---|---|
| Amazon SES | `email-smtp.<region>.amazonaws.com` | 587 or 465 | The SMTP username SES generates (not your AWS access key) |
| Mailgun | `smtp.mailgun.org` or `smtp.eu.mailgun.org` | 587 or 465 | The SMTP login for your domain |
| Postmark | `smtp.postmarkapp.com` | 587 | Your server API token (also the password) |
| SendGrid | `smtp.sendgrid.net` | 587 or 465 | `apikey` |
| Brevo | `smtp-relay.brevo.com` | 587 | Your SMTP login |
| Resend | `smtp.resend.com` | 465 or 587 | `resend` |

## Test it

1. Sign up a test user with an address you can read, or call `supabase.auth.resetPasswordForEmail('you@example.com')` from your app.
2. Check that the email arrives from your sender address and lands in the inbox, not spam.
3. If nothing arrives, look at your provider's sending log first. It shows whether the provider received the email and why it was rejected or bounced.

Common causes of failures:

- **Sender domain not verified.** The provider refuses mail from an unverified domain.
- **Wrong port for the TLS mode.** Use 465 for TLS from the start, 587 for STARTTLS.
- **Sandbox or trial account.** Amazon SES starts in a sandbox that only sends to verified addresses. Request production access first.
- **Rate limit reached.** Auth returns `over_email_send_rate_limit` when the hourly limit is used up. Raise **Emails per hour** if your traffic needs it.

## Choosing the limits

**Emails per hour** applies to the whole project. Set it high enough for your busiest hour of sign-ups and password resets, but not so high that a script abusing your sign-up form can run up your provider bill. Your provider's own sending limits still apply on top.

**Minimum gap per user** stops one address from being sent email after email. The default of 60 seconds suits most apps. Show a countdown on your "resend email" button that matches it.

See [Auth rate limits](/docs/auth/rate-limits) for the other limits and what users see when they hit one.

## Deliverability

Your own domain gives you more control, and more responsibility:

- Publish SPF and DKIM records as your provider asks, and add a DMARC record for the domain.
- Use a sender address on a domain or subdomain you only use for transactional email, such as `auth.example.com`, so marketing email doesn't affect its reputation.
- Keep the **Skip email confirmation** setting off, so bots that sign up with fake addresses don't cause bounces.

## Related

- [Auth emails and templates](/docs/auth/email-templates)
- [Not receiving Auth emails](/kb/not-receiving-auth-emails)
- [Email providers](/docs/integrations/resend)
