Email
API Key
Mailgun REST API
Powerful email API for developers
Mailgun is a transactional email API service built for developers. It provides powerful sending infrastructure, advanced analytics, and email validation to ensure reliable email delivery at scale. Developers use Mailgun for transactional emails, marketing campaigns, email validation, and comprehensive tracking of email performance.
Base URL
https://api.mailgun.net/v3
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /messages | Send an email message with HTML content, attachments, and custom headers |
| GET | /events | Retrieve email events including delivered, opened, clicked, bounced, and failed |
| POST | /messages.mime | Send a MIME-formatted email message for full control over email structure |
| GET | /domains | List all domains configured in your Mailgun account |
| POST | /domains | Add a new domain to your Mailgun account for sending emails |
| GET | /domains/{domain}/credentials | Get SMTP credentials for a specific domain |
| POST | /address/validate | Validate email addresses to check syntax and deliverability |
| GET | /stats/total | Get aggregate statistics for emails sent, delivered, opened, and clicked |
| POST | /lists | Create a mailing list for managing email recipients |
| GET | /lists/{list}/members | Retrieve all members of a specific mailing list |
| POST | /lists/{list}/members | Add a new member to a mailing list with optional custom variables |
| GET | /bounces | Retrieve the list of bounced email addresses |
| DELETE | /bounces/{address} | Remove an email address from the bounce list |
| POST | /routes | Create a route to forward or store incoming emails based on patterns |
| GET | /webhooks | List all configured webhooks for email event notifications |
Code Examples
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN/messages \
-F from='Sender <sender@YOUR_DOMAIN>' \
-F to='recipient@example.com' \
-F subject='Hello from Mailgun' \
-F text='This is a test email sent via Mailgun API' \
-F html='<html><body><h1>Hello!</h1><p>This is a test email.</p></body></html>'
Connect Mailgun to AI
Deploy a Mailgun MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to Mailgun through these tools:
send_email
Send transactional emails with custom content, recipients, and attachments via Mailgun API
validate_email
Validate email addresses for syntax and deliverability before sending messages
get_email_events
Retrieve email delivery events including opens, clicks, bounces, and failures for tracking
manage_mailing_list
Create and manage mailing lists, add/remove members, and retrieve subscriber information
check_email_stats
Fetch aggregate email statistics including delivery rates, open rates, and click rates
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy Mailgun MCP Server →