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

# SMTP

> Send through any SMTP provider.

SMTP is the standard way email servers accept mail, and almost every email provider supports it. Connect yours with its SMTP settings.

> [!WARNING]
>
> Bounces and spam complaints aren't handled with SMTP. SMTP has no standard way to report them, so subscriber.dev keeps emailing addresses that bounce or mark you as spam until you opt them out. See [Bounces](#bounces). Use a built-in integration, like [Resend](https://docs.subscriber.dev/integrations/resend.md), [Postmark](https://docs.subscriber.dev/integrations/postmark.md) or [Amazon SES](https://docs.subscriber.dev/integrations/ses.md), to opt them out for you.

## Connect

Or ask [your agent](https://docs.subscriber.dev/mcp.md): "Connect my Postmark account over SMTP, sending from [hello@acme.com](mailto:hello@acme.com)."

> [tab] CLI
>
> ```bash theme={null}
> subscriber integrations set smtp --body '{
>   "host": "smtp.postmarkapp.com",
>   "port": 587,
>   "secure": false,
>   "fromEmail": "hello@acme.com",
>   "fromName": "Acme",
>   "user": "<server token>",
>   "password": "<server token>"
> }'
> ```

> [tab] TUI
>
> Open **Integrations**, press `n` and choose **SMTP**.

> [tab] API
>
> ```bash theme={null}
> curl -X PATCH https://api.subscriber.dev/integrations/smtp \
>   -H "x-api-key: $KEY" -H "content-type: application/json" \
>   -d '{"host": "smtp.postmarkapp.com", "port": 587, "secure": false, "fromEmail": "hello@acme.com", "user": "<server token>", "password": "<server token>"}'
> ```

## Settings

| Field | Description |
| - | - |
| `host`, `port` | Your provider's SMTP server. |
| `secure` | `true` for port 465. `false` for 587, which upgrades to TLS once connected. Defaults to `true`. |
| `user`, `password` | Your SMTP login. Some providers use an API key for both. |
| `fromEmail`, `fromName` | Who the email is from. |
| `replyTo` | Where replies go, if not `fromEmail`. Useful when you send from a subdomain with no inbox. |

## Provider settings

| Provider | Host | Port and `secure` | `user` |
| - | - | - | - |
| Resend | `smtp.resend.com` | 465, `true` | `resend` |
| Amazon SES | `email-smtp.<region>.amazonaws.com` | 465, `true` | Your SES SMTP username |
| Postmark | `smtp.postmarkapp.com` | 587, `false` | Your server token |
| Mailgun | `smtp.mailgun.org` | 465, `true` | Your domain's SMTP login |
| SendGrid | `smtp.sendgrid.net` | 465, `true` | `apikey` |

The password is the API key or SMTP password from your provider.

## Bounces

Check bounces and spam complaints in your provider's dashboard, and opt out dead addresses with `subscriber subscribers update-preferences <subscriberId> --opted-out`. Opted-out subscribers are never emailed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.