> For the complete documentation index, see [llms.txt](https://docs.mailofly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailofly.com/changelog/email-infrastructure/smtp-providers.md).

# SMTP providers

Mailofly sends through **your** SMTP server — any provider that supports authenticated relay works out of the box.

***

## Supported providers

| Provider               | SMTP host                           | Port       | Username                          |
| ---------------------- | ----------------------------------- | ---------- | --------------------------------- |
| **SendGrid**           | `smtp.sendgrid.net`                 | 587        | `apikey`                          |
| **Mailgun**            | `smtp.mailgun.org` (or regional)    | 587        | `postmaster@yourdomain`           |
| **Amazon SES**         | `email-smtp.{region}.amazonaws.com` | 587        | SMTP credentials from SES console |
| **Postmark**           | `smtp.postmarkapp.com`              | 587        | Server token                      |
| **Brevo (Sendinblue)** | `smtp-relay.brevo.com`              | 587        | Your login email                  |
| **Custom / cPanel**    | Your host's SMTP                    | 587 or 465 | Mailbox or relay user             |

***

## Setup in Mailofly

1. [**Accounts**](https://www.mailofly.com/user/accounts) **→ Add account → SMTP**
2. Enter provider credentials
3. Set **daily mail limit** conservatively (start at 100–500/day)
4. **Send test** to verify
5. Copy the **`acc_…` key** for API compose calls

### Via API

```bash
curl -sS -X POST "https://www.mailofly.com/api/v1/accounts" \
  -H "Authorization: Bearer mf_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SendGrid transactional",
    "provider_type": "smtp",
    "smtp_host": "smtp.sendgrid.net",
    "smtp_port": 587,
    "smtp_username": "apikey",
    "smtp_password": "SG.your_api_key",
    "daily_mail_limit": 500
  }'
```

***

## Provider-specific tips

### SendGrid

* Use an **API key** with Mail Send permission as the SMTP password
* Username is always `apikey`
* Set up [domain authentication](https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication) in SendGrid for best deliverability

### Amazon SES

* Generate **SMTP credentials** (not IAM keys) from the SES console
* Verify your domain in SES **and** in Mailofly [Domains](https://docs.mailofly.com/guides/domains) if using domain relay
* Request production access to leave the SES sandbox

### Mailgun

* Use the SMTP credentials from your Mailgun domain settings
* Regional endpoints matter — match your Mailgun region

***

## SMTP vs domain relay

|                  | SMTP account        | Domain relay                |
| ---------------- | ------------------- | --------------------------- |
| Credentials      | Your ESP SMTP login | Verified domain in Mailofly |
| Sending path     | Direct to your ESP  | Mailofly → Amazon SES       |
| From address     | ESP-dependent       | Your `@domain.com`          |
| Setup complexity | Low                 | Medium (DNS records)        |

Use SMTP when you already have an ESP relationship. Use [domain relay](https://docs.mailofly.com/guides/domains) for fully branded sends managed in Mailofly.

***

## Related

* [Sending accounts](https://docs.mailofly.com/guides/accounts)
* [Domains & DNS](https://docs.mailofly.com/guides/domains)
* [API: Accounts](https://docs.mailofly.com/api/accounts)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mailofly.com/changelog/email-infrastructure/smtp-providers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
