# Mailgun

> Email API and SMTP relay for sending, receiving and tracking email.

- Category: [Transactional email](https://freetier.tech/c/email.md)
- Free tier: Always free. 100 emails per day with 1 custom sending domain and 1-day log retention.
- Commercial use not stated
- No card required
- Pricing: https://www.mailgun.com/pricing/
- Last verified: 2026-10-28

## Free tier limits

- 100 emails per day
- 1 custom sending domain
- 2 API keys
- 1-day log retention
- 1 inbound route
- 1 user per account

## Gotchas

- Account activation requires verifying your email and a mobile number by SMS; VoIP, virtual and landline numbers are not accepted.
- The built-in sandbox domain only delivers to up to 5 authorized recipients, who must each confirm by email; verify a custom domain to send to anyone.
- Domains created in the EU region must use https://api.eu.mailgun.net instead of https://api.mailgun.net.
- Domain sending keys can only send messages; listing or managing domains needs an account API key.

## Setup

### What the human does

1. Sign up at https://signup.mailgun.com/new/signup.
2. Activate the account by verifying your email address and a mobile phone number (SMS code).
3. Create an API key at https://app.mailgun.com/settings/api_security.
4. Add your sending domain's DNS records at your DNS provider, or add yourself as an authorized recipient to test with the sandbox domain.

### How the agent gets access

#### API key

- Get it at: https://app.mailgun.com/settings/api_security
- Env var: `MAILGUN_API_KEY`
- Notes: HTTP Basic auth with username `api`; the official MCP server reads MAILGUN_API_KEY (and MAILGUN_API_REGION=eu for EU accounts).

### Verify

```sh
curl -s --user "api:$MAILGUN_API_KEY" https://api.mailgun.net/v4/domains
```

## Docs

- Quickstart: https://documentation.mailgun.com/docs/mailgun/quickstart
- llms.txt: https://documentation.mailgun.com/llms.txt

## Sources

- https://www.mailgun.com/pricing/
- https://www.mailgun.com/features/email-api/
- https://help.mailgun.com/hc/en-us/articles/203068914-What-does-the-Free-plan-offer
- https://help.mailgun.com/hc/en-us/articles/37182933150491-Account-Activation
- https://help.mailgun.com/hc/en-us/articles/217531258-Authorized-Recipients
- https://documentation.mailgun.com/docs/mailgun/quickstart
- https://documentation.mailgun.com/docs/mailgun/user-manual/domains/domains-sandbox
- https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview
- https://documentation.mailgun.com/docs/mailgun/api-reference/mg-auth
- https://documentation.mailgun.com/docs/mailgun/user-manual/api-key-mgmt/rbac-mgmt
- https://documentation.mailgun.com/docs/mailgun/api-reference/send/mailgun/domains/get-v4-domains
- https://documentation.mailgun.com/docs/mailgun/mcp
- https://documentation.mailgun.com/docs/mailgun/sdk/nodejs_sdk
- https://www.mailgun.com/legal/terms/
- https://documentation.mailgun.com/llms.txt

JSON: https://freetier.tech/api/v1/services/mailgun.json
