
Scale with the best email API for developers
Mailgun's Email API makes integrating email into your applications incredibly easy with our RESTful architecture design and comprehensive documentation.
RESTful APIs integrate email into your application seamlessly
Built on Google with 99.99% Server Uptime
GDPR, HIPAA, and ISO 27001 compliant
Real-time logs and analytics in one powerful email API platform
Mailgun gives you full transparency into your email deliveries with logs and analytics. You can track message performance based on email service providers, device type, and location. This means you can easily evaluate open and click-through rates, assess the importance of designing for mobile devices, and get a higher return the next time you send to your email list. If a delivery failure occurs, we deliver detailed log feedback to diagnose the problem quickly.


"For us, at the volume we're sending – every fraction of a percentage means a potential customer, and as a community of designers, it's our job to create meaningful touchpoints. High deliverability ensures that our messages and our reach are seen; any improvement in our email program has a huge effect on our business."

Michael Sacca
Vice President of Product at Dribbble

An Email API for seamless inbound parsing and delivery
Our email API also offers robust email parsing and routing features, making inbound processing simple and streamlined. Avoid throws and achieve high levels of email delivery.
Stop email spoofing before it starts
With Mailgun, companies are empowered to send their emails straight to the inbox through various email authentication protocols. Integrate authentication protocols like SPF, DKIM, and DMARC within Mailgun’s API to avoid misalignment before you even start sending and keep bad actors from impersonating your brand.


Email API setup made simple: Get your API key and start coding
When you’re ready to get started using Mailgun’s email delivery service, you’ll be able to find a personalized API key in your user dashboard. Mailgun has published client libraries for a variety of programming languages, including Python, Ruby, Java, and C. View code samples for each language.
An email service designed for high performance
Mailgun’s free email API gives you the ability to send emails at scale. Use your API key to take the stress out of email marketing, with features such as:
Automated warmup of dedicated IP addresses and isolation of each sending domain to protect your reputation
Batch sending of up to 1,000 personalized emails at a time
Email delivery monitoring and optimization
Email segmentation for simple A/B testing
The ability to schedule email delivery
Our RESTful API makes it simple to use standard HTTP operations, providing outputs in flexible data formats, including application/JSON. If you prefer a different configuration, you can also send emails directly through SMTP servers.

Frequently asked questions (FAQs)
Is Mailgun email API secure?
We take security and privacy seriously. Mailgun is both SOC I & II compliant as well as HIPAA compliant. For a full list of compliance certificates, as well as our request form for compliance proof - please refer to our security portal.
What pricing plans does Mailgun offer?
Mailgun offers four flexible email sending plans, each with a set monthly email allowance and overage pricing.
Sign up today to try our self-service email API. Send 100 emails/day free, with packages starting at just $15/month. Looking to send more than 250MM emails/month? Talk with sales to schedule a demo.
How does Mailgun manage bounces, suppressions, and email deliverability feedback?
Mailgun automatically classifies and records bounce events (hard and soft), spam complaints, and unsubscribes into a Suppressions list. Once an address is added to your suppressions, Mailgun prevents further delivery attempts to protect your sending reputation. You can query or purge suppression records via the API or dashboard.
Additionally, Mailgun provides real‑time event logs and webhooks to stream bounce and delivery data to your systems for monitoring and automated handling.
Can I send email via SMTP with Mailgun instead of using the HTTP email API?
Yes. In addition to its RESTful Email API, Mailgun supports the standard SMTP protocol (with or without TLS). You simply point your mail client or SMTP library to Mailgun’s SMTP endpoint and authenticate using your SMTP credentials, making it compatible with virtually any email‑sending tool or library.
Does Mailgun offer dedicated IP addresses, and how do I obtain and assign one to my domain?
Mailgun offers dedicated IPs starting on the foundation plan (and IP pools at Scale and up) so you control your sending reputation:
When to use: High volume or reputation‑sensitive senders who need isolation from shared‑IP behavior
How to get one: In the Control Panel’s IP Management section, click “Add Dedicated IP”
Assignment: Once provisioned, you can assign the dedicated IP to any custom sending domain on your account. Mailgun also offers automated warm‑up for new IPs to build positive reputation over time
What third‑party integrations are available with Mailgun (e.g., CRM, e‑commerce, automation tools)?
Mailgun maintains a broad ecosystem of integrations, including:
CRM & Marketing: ActiveCampaign, HubSpot (via Zapier)
E‑commerce: BigCommerce, Amazon Seller Central
Productivity: Asana, Airtable
Billing & Payments: Braintree
Custom & No‑Code: Zapier (connect to 7,000+ apps)
You can browse and install these directly from Mailgun’s Integrations page, or leverage Zapier to build custom workflows without code.
Mailgun Email Security Capabilities
We take security seriously to ensure the integrity of our platform and the protection of our customers' data. Download the Mailgun guide to email security and compliance for more information.
Sender Authentication
Mailgun supports DMARC, DKIM, and SPF for email authentication, reducing the risk of spoofing.
Webhook Security
Protects your webhooks with signature validation to ensure secure, tamper-free requests.
Access Management
Secure access with Two-Factor Authentication (2FA), IP access management, and API keys to safeguard sensitive data.
Single Sign-On (SSO)
Streamlined login with SSO for enhanced security and convenience.
Data Encryption
We utilize AES-256 encryption-at-rest for all customer data.
Acceptable Use Policy (AUP)
Mailgun protects senders' reputations by enforcing guidelines for bounce rates, spam complaints, list sourcing, and prohibited content.