In-depth two-product comparison
SendGrid vs Mailgun
A practical comparison of SendGrid and Mailgun for B2B SaaS teams, covering API delivery, campaigns, inbound routing, validation, retention, pricing and migration.
Last updated: 2026-10-09
Short answer
Choose SendGrid when a B2B SaaS needs application delivery and a real campaign operation in the same vendor family. Twilio lists an Email API with Essentials and Pro tiers, subusers, an Event Webhook and dedicated IP access on Pro, while Marketing Campaigns adds contact management and campaign sending under its own plans. Choose Mailgun when engineering owns the mail pipeline and needs developer-first API and SMTP delivery, routes for inbound mail, email validation and visible log-retention boundaries. Mailgun lists Foundation at $35 per month for 50,000 emails and Scale at $90 per month for 100,000 emails; SendGrid lists Email API Essentials at $19.95 per month for 50,000 emails. At that shared published volume, SendGrid is the lower listed subscription, while Mailgun offers a more explicit receiving and validation toolkit.
SendGrid
A broad Twilio email stack for application delivery plus campaigns
Mailgun
A developer-first API with strong inbound routing and validation
The decision is an ownership question. SendGrid joins application delivery to a separate campaign product; Mailgun keeps sending, receiving, validation and operational controls close to developers.
Quick comparison
| Decision area | SendGrid | Mailgun | What to verify |
|---|---|---|---|
| Best for | Teams combining product email with Marketing Campaigns | Engineering-led sending, receiving and validation | Confirm which team owns contacts, routes and event processing. |
| Starting published price | Essentials: $19.95/mo for 50,000 emails | Basic: $15/mo for 10,000 emails | Both prices are listed monthly; Mailgun Foundation is $35/mo for 50,000. |
| Application delivery | Email API and SMTP relay | REST API and SMTP relay | Map API keys, sender domains, templates and retry ownership. |
| Marketing campaigns | Separate Marketing Campaigns product | Not the centre of the platform | Budget a separate campaign system when Mailgun is the delivery layer. |
| Inbound email | Inbound Parse webhook | Routes and inbound parsing | Test attachments, sender checks and route failures with realistic replies. |
| Email validation | Available through an add-on path | Mailgun Optimize validation | Decide whether registration-time and bulk checks are required. |
| Log retention | Plan and account configuration dependent | 1 day Free and Basic, 5 days Foundation, 30 days Scale | Match retention with support and incident requirements. |
| Dedicated IP | Included on Pro; higher tiers have dedicated options | Included with qualifying Scale use; extra IPs list at $59/IP/month | Plan warm-up, authentication and traffic volume before purchase. |
| Regional sending | Twilio DPA is published; region choice needs review | US and EU sending regions are listed | Confirm data-flow and residency needs with procurement. |
Use a listed volume point, multiply the listed monthly amount by 12 and keep campaigns, validation, dedicated IPs and retention exports as separate lines. A published plan is a budget anchor, not a promise that every workload fits without design work.
Feature comparison
| Feature | SendGrid | Mailgun |
|---|---|---|
| API shape | Email API for transactional sending, templates, categories and event callbacks. | Developer-first REST API with sending, receiving, routing and validation surfaces. |
| SMTP migration | SMTP relay can keep older services sending while newer services use the API. | SMTP relay is available alongside the API, useful during a staged service migration. |
| Template ownership | Dynamic templates can be maintained in SendGrid while product code supplies data. | Templates and variables fit an application-owned workflow built around the API. |
| Delivery events | Event Webhook can feed delivery, bounce and engagement events into a central consumer. | Events and logs support an application consumer, with retention varying by plan. |
| Multiple products | Email API and Marketing Campaigns are distinct products with distinct limits. | The platform stays centred on email infrastructure and operational controls. |
| Inbound parsing | Inbound Parse sends parsed messages to an endpoint for application processing. | Routes can direct incoming messages by recipient, domain or matching rules. |
| Routing depth | Suitable for straightforward reply handling where the application owns classification. | Flexible routes suit support aliases, ticket ingestion and address-specific workflows. |
| Validation | Validation is an additional product decision rather than the centre of the API plan. | Mailgun Optimize provides real-time and bulk validation paths. |
| Suppression | Bounces, blocks and unsubscribes can be consumed through event handling. | Suppression and event review sit alongside sending and log operations. |
| Attachments | Transactional messages can carry attachments subject to API and message limits. | Inbound processing needs explicit attachment and malware-handling decisions in the receiving service. |
| Subusers and separation | Subusers can separate products, environments or customer-facing senders. | Account, domain and route boundaries need to be designed around the engineering team. |
| Dedicated IP path | Pro lists dedicated IP access; the sender still owns authentication and warm-up. | Scale includes a dedicated IP in qualifying configurations; extra IPs list at $59 each per month. |
| Logs | Use the selected plan and account settings to define investigation and export practice. | Mailgun lists one day on Free and Basic, five days on Foundation and 30 days on Scale. |
| Regional choice | Review Twilio’s DPA and the account’s actual processing path with legal and security. | US and EU sending regions are listed, which can simplify a regional architecture discussion. |
| Marketing scale | Marketing Campaigns has contact and monthly-send tiers separate from Email API. | Campaign scheduling and audience work generally belong in another system. |
Pricing and operating cost
SendGrid
Email API Free Trial: $0 for 100 emails/day for 60 days. Marketing Campaigns Free: $0 for up to 2,000 contacts and 6,000 emails/month.
Marketing Campaigns is a separate budget line from Email API. Taxes and overages may apply to listed plan starting prices. Dedicated IP work still needs authentication, warm-up and monitoring ownership.
Mailgun
Free: $0 for 100 emails/day. Mailgun also lists one month free on Foundation and Scale before the listed paid price.
Extra email and validation usage is charged according to the selected plan’s listed terms. Additional dedicated IPs list at $59 per IP per month. Short log retention on lower plans may require an export pipeline or a higher tier.
| Tier or usage case | SendGrid | Mailgun |
|---|---|---|
| Free / trial | $0 Email API: 100 emails/day for 60 days; Marketing Campaigns Free: 2,000 contacts and 6,000 emails/month. | $0 100 emails/day, one custom sending domain and one day of log retention. |
| Entry plans | Essentials: $19.95/mo Email API selector point for 50,000 emails/month; taxes and overages may apply. | Basic: $15/mo 10,000 emails/month; one day of log retention; extra emails list from $1.80 per 1,000. |
| 50,000-email point | Essentials: $19.95/mo Email API Essentials selection for 50,000 emails/month. | Foundation: $35/mo 50,000 emails/month after the first month; five days of log retention; extra emails list from $1.30 per 1,000. |
| 100,000-email point | Pro: $89.95/mo Pro selection for 100,000 emails/month; dedicated IPs included. | Scale: $90/mo 100,000 emails/month after the first month; 30 days of log retention and 5,000 validations included. |
| Campaign product | Marketing Campaigns Basic: $15/mo Basic starts with up to 100,000 contacts and 300,000 emails/month; smaller selector points include 5,000 contacts for $15 and 10,000 for $25. | Pricing on request Mailgun is an infrastructure service; price a separate campaign product if the team needs visual journeys and audience management. |
SendGrid: a broad Twilio stack with two operating centres
SendGrid is easiest to understand as two related products. The Email API serves product-generated mail such as invitations, password resets, invoices, usage notices and security alerts. It can be called over REST or SMTP, and the Event Webhook can stream delivery outcomes to an application service. Marketing Campaigns is a separate surface for contacts, campaign composition and scheduled communication. A B2B SaaS can use both, but it should give them separate owners, separate forecasts and a clear consent boundary.
The Twilio ownership context matters for procurement and account administration. A platform team may already have account controls, subusers and a central event pipeline. Subusers can help isolate a product, environment or customer-facing sender, but each additional boundary creates keys, domains, templates and support paths to govern. Set naming conventions before the first production send: include environment, product and message class in every sender identity and event ledger.
For transactional work, SendGrid’s useful pattern is a stable application contract. The service decides which template and category to use; SendGrid handles the delivery request and emits an event; the application stores the provider identifier with the business event. Categories and subusers can make reporting more useful, but they do not replace an internal message ledger. Keep invoice identifiers, account identifiers and consent state in the system that owns them.
Marketing Campaigns changes the operating model. The product lists contact limits and monthly-send limits of its own, so a campaign forecast should not be folded into Email API volume. Marketing can own the editor and calendar while engineering owns transactional templates and event handling. Document how unsubscribe groups, suppression and domain authentication are shared. That agreement prevents a campaign editor from accidentally changing the delivery behaviour of a password reset.
SendGrid lists Email API Pro with dedicated IPs included. A dedicated IP can make sense for a stable, high-volume sender with a deliberate warm-up plan; it is not a shortcut for weak authentication or inconsistent content. A smaller SaaS may prefer shared infrastructure while it establishes SPF, DKIM, DMARC, bounce handling and complaint review. Reassess when traffic is predictable and the operations team can monitor the IP every day.
- Assign one owner to Email API delivery and another to Marketing Campaigns when both products are active.
- Send Event Webhook events to an idempotent endpoint with signature checks, retries and a dead-letter path.
- Keep transactional and campaign suppression rules explicit, with a documented source of truth for consent.
- Use subusers for real operational boundaries, not as a substitute for a message inventory or access review.
Mailgun: developer-first sending, receiving and validation
Mailgun is a natural fit when engineers want email infrastructure close to application code. The API and SMTP relay cover ordinary outbound messages, while routes and inbound parsing let the service receive replies and forward structured payloads to an endpoint. This is useful for support aliases, ticket creation, reply-to workflows and product addresses that need machine processing. The design responsibility stays with the team: route precedence, untrusted input, attachment handling and loop prevention need explicit tests.
Mailgun’s inbound model changes what “email provider” means in an architecture. The team is not only sending a notification; it may also be accepting an email from the public internet. Create a receiving boundary that verifies the destination, logs the provider event, limits attachment size, scans or quarantines files and hands only the required fields to the product. Never let a route turn an arbitrary sender into a privileged product action without an application-level authorization check.
Email validation is another Mailgun distinction. Optimize can support checks at sign-up and bulk hygiene before a campaign or customer import. Decide whether a validation result is advisory or blocking, how long it is retained and whether the product can appeal a false positive. For a B2B SaaS, validation can protect a shared sending domain, but it should sit beside consent and suppression rather than replace them. An address that is deliverable can still be unwelcome.
Mailgun’s plans make operational limits visible. Free and Basic list one day of log retention, Foundation lists five days, and Scale lists 30 days. That affects support. If a customer reports a missing invite after the retention window, the application must still have its own message identifier, request time, recipient hash and final event. Export only the data needed for troubleshooting, apply access controls and set a deletion schedule that matches the company’s policy.
Mailgun lists Foundation at $35 per month for 50,000 emails and Scale at $90 per month for 100,000 emails. Scale also lists 5,000 validations and 30 days of logs, while a qualifying configuration includes one dedicated IP. The service lists US and EU sending regions, which can simplify a regional deployment conversation. Confirm the selected region, domains and data paths during implementation rather than assuming an account setting applies to every feature.
- Treat routes as internet-facing application ingress with authentication, limits and audit logs.
- Choose a log-retention tier that matches the support window, or export delivery events to a protected internal store.
- Use Optimize validation where it solves a measured hygiene problem; keep consent and suppression authoritative elsewhere.
- Separate inbound reply processing from outbound delivery permissions and rotate credentials by environment.
Worked cost scenario: 50,000 emails every month
Consider a B2B SaaS that sends 50,000 application messages each month: 16,000 invitations and verification links, 12,000 billing notices, 11,000 workflow alerts and 11,000 security or account messages. It needs REST API delivery, templates, bounce events and a support reply route. It does not need a campaign editor in this calculation. Both vendors list a plan at the same 50,000-email point, so the arithmetic uses those published selections.
SendGrid lists Email API Essentials at $19.95 per month for 50,000 emails. Mailgun lists Foundation at $35 per month for 50,000 emails after the first month. The annual arithmetic is SendGrid: 12 × $19.95 = $239.40. Mailgun: 12 × $35 = $420. The listed subscription difference is $420 - $239.40 = $180.60 per year. This is a comparison of the named plan points; it does not turn an unlisted volume into an estimated overage.
The lower SendGrid subscription does not automatically make it the lower total operating cost. If the SaaS needs Mailgun’s inbound routes, validation and five-day logs, it should price the engineering time and alternative services that SendGrid would require. If the SaaS needs contact management, campaign editing and a scheduled newsletter, it should add SendGrid Marketing Campaigns or a separate campaign product to the Email API line. Treat those needs as architecture choices, not as invisible features of the transactional tier.
At 100,000 monthly emails, SendGrid lists Pro at $89.95 per month and Mailgun lists Scale at $90 per month. The arithmetic is SendGrid: 12 × $89.95 = $1,079.40. Mailgun: 12 × $90 = $1,080. The annual difference is $0.60 before taxes and add-ons. At that point the choice is shaped more by dedicated IP scope, validation, log retention, inbound routing and campaign ownership than by the listed base subscription.
A finance review should keep each line legible: base plan, published included volume, validation, dedicated IPs, campaign contacts, retention exports, regional requirements and support work. Do not combine a campaign contact tier with an Email API send tier and call it one blended price. The people approving the budget need to see which service owns each workload and what changes when message volume or product scope changes.
- Freeze the definition of a monthly send, including retries and test traffic.
- Select the exact published 50,000 or 100,000 point on each pricing page.
- Multiply the listed monthly price by 12 and keep campaign, validation, IP and retention lines separate.
- Run a representative message and inbound-reply sample before committing to a routing design.
- Reconcile provider invoices against the internal message ledger after the first full month.
Migration notes: move the message contract, not only the key
A move between SendGrid and Mailgun starts with an inventory. List every sender domain, return path, template, API key, SMTP credential, webhook consumer, inbound route, suppression rule, campaign contact source and service owner. Separate SendGrid Email API from Marketing Campaigns. On Mailgun, separate outbound streams from routes and validation calls. The inventory should name what happens on a hard bounce, a temporary failure, an unsubscribe, a complaint and a malformed inbound message.
Domain work should happen before application cutover. Confirm SPF, DKIM, DMARC, tracking domains, return paths and regional choices. Lower DNS TTL ahead of the change where practical, but do not remove the old records until the new path has delivered a controlled sample. A dedicated IP migration needs its own warm-up schedule. Shared-to-shared moves still need a gradual ramp because recipient expectations and message patterns matter more than the provider brand.
Templates often hide the hardest compatibility work. Export subject, preheader, variables, fallback values, localization, unsubscribe behaviour and attachment rules. Rebuild each template in the destination syntax and render fixtures with long company names, missing optional fields, right-to-left text, invoices, failed payments and security alerts. Test links and tracking domains. Keep a stable internal template identifier so analytics and support can compare the old and new provider without confusing a renamed template for a new message.
Inbound migration needs a separate rehearsal. Send replies to every route, include an attachment and an unexpected sender, and verify that the receiving endpoint rejects malformed or replayed requests. Check route order and loops. If replies create tickets, make the ticket identifier idempotent. Keep the old route available during a short overlap, but do not process the same inbound message twice. Log provider message identifiers and a migration cohort on every test.
Cut over by message class. Start with internal accounts, then invitations, then routine notices, then higher-risk billing and security messages. Compare delivery, bounce, block, complaint, latency, route and webhook outcomes. Keep the old credentials read-only while support closes open incidents. After the new provider is stable, revoke old keys, remove stale DNS assumptions and archive the mapping of old templates, routes and suppression groups.
- Create a message matrix with event, sender, template, domain, recipient class, suppression rule, route and owner.
- Verify DNS, authentication, region and retention choices with security and legal.
- Rebuild templates and run visual, localization, link and attachment tests.
- Implement webhook and inbound consumers with idempotency, signature checks and replay protection.
- Ramp one message class at a time and compare provider events with the internal ledger.
- Close the overlap by revoking credentials and preserving a support-readable migration map.
Which team should pick which?
Pick SendGrid when marketing and product communications are both first-class work. A B2B SaaS may want engineers to send receipts and alerts through Email API while lifecycle or growth staff manage contacts and scheduled campaigns in Marketing Campaigns. SendGrid’s subusers and Event Webhook also suit a larger platform team with several services. The cost is coordination: the organization must define how two products share domains, suppression, consent, reporting and access.
Pick Mailgun when the mail system is primarily an engineering surface. It is compelling for teams that need API and SMTP delivery, inbound routes, validation and logs close to code and infrastructure. A support product that turns replies into tickets, an integration that parses inbound commands, or a sign-up flow that validates addresses can use the same provider family. The cost is that campaign management remains a separate product decision and the team must own receiving security.
Choose based on the operational owner rather than a feature checklist. If a campaign manager is accountable for an audience calendar, SendGrid’s second product may reduce vendor sprawl. If a platform engineer is accountable for webhooks, routes, validation and retention, Mailgun’s vocabulary may fit better. In either case, keep the message ledger, consent source and suppression authority inside the company’s architecture. A provider should report delivery; it should not silently become the only copy of business truth.
A smaller SaaS can start with the lower listed 50,000-email SendGrid tier when it needs only outbound transactional delivery and has no inbound or validation requirement. It can start with Mailgun Foundation when route handling, validation or five days of logs are worth the price difference. A larger SaaS should compare the 100,000-email points, then add the people and systems needed for dedicated IP warm-up, campaign governance, regional review and incident response.
Pros and cons
SendGrid
Pros
- Email API and Marketing Campaigns cover application and campaign work in the Twilio family.
- Subusers, SMTP relay and Event Webhook help a multi-service B2B SaaS separate operational responsibilities.
- Essentials lists $19.95 per month for 50,000 emails and Pro lists $89.95 per month for 100,000 emails.
- Marketing Campaigns lists distinct contact and monthly-send tiers.
Cons
- Email API and Marketing Campaigns have separate pricing, limits and owners.
- Inbound parsing is a simpler fit for straightforward reply forwarding than complex route trees.
- A broad account can accumulate more keys, subusers, templates and event consumers to govern.
- Premier and custom high-volume work is pricing on request.
Mailgun
Pros
- API, SMTP relay, routes, inbound parsing and validation suit an engineering-owned mail pipeline.
- Foundation lists 50,000 emails at $35 per month and Scale lists 100,000 at $90 per month.
- Scale lists 30 days of log retention and 5,000 validations.
- US and EU sending regions are listed, and dedicated IP options are explicit.
Cons
- Campaign editing, contact calendars and complex lifecycle journeys usually need another tool.
- Free and Basic list only one day of log retention.
- Additional dedicated IPs list at $59 per IP per month.
- Inbound routes require security, loop prevention, attachment handling and application-level authorization.
Who should choose what?
Product mail plus a campaign calendar
Growth owns contacts and scheduled campaigns while engineering owns receipts, invitations and alerts.
Recommendation: SendGrid. SendGrid keeps Email API and Marketing Campaigns in one Twilio family, with separate plans that can be governed explicitly.
Support replies become tickets
The product receives replies, parses them and routes them into a ticketing workflow.
Recommendation: Mailgun. Mailgun’s routes and inbound parsing are a direct fit for an engineering-owned receiving boundary.
50,000 transactional emails
The team wants a published plan point and no campaign editor in the first budget.
Recommendation: SendGrid. SendGrid lists Essentials at $19.95 per month versus Mailgun Foundation at $35 per month for 50,000 emails; choose Mailgun if its routes and validation replace other work.
Registration-time validation
The product needs to check addresses before creating accounts and clean imported lists.
Recommendation: Mailgun. Mailgun Optimize puts real-time and bulk validation alongside the sending API.
100,000 monthly emails and dedicated IP planning
The sender has a stable volume and an operations owner for authentication and warm-up.
Recommendation: SendGrid. SendGrid Pro lists $89.95 per month at 100,000 emails with dedicated IPs included; Mailgun Scale lists $90 and its own dedicated IP scope.
Application-only delivery
Campaigns stay in another platform and the team wants the delivery layer close to product code.
Recommendation: Mailgun. Mailgun keeps the centre of gravity on API, SMTP, events, routes, validation and operational logs.
A safe migration preserves the message contract: sender identity, template variables, consent, suppression, provider events, inbound routes and internal ownership. The provider should fit the people who will debug the first failed delivery at 02:00.
Final verdict
Choose SendGrid if
- Application delivery and a campaign program need one vendor family.
- Subusers, SMTP relay and Event Webhook fit a multi-service platform team.
- Essentials at $19.95 per month for 50,000 emails fits the initial outbound budget.
- Pro’s listed dedicated IP path suits a stable sender with a warm-up owner.
- Marketing can own contacts while engineering owns Email API contracts.
Choose Mailgun if
- Engineering needs outbound API, SMTP, inbound routes and parsing.
- Email validation belongs close to registration and import workflows.
- Foundation’s five-day logs or Scale’s 30-day logs match support requirements.
- US and EU sending regions are part of the architecture discussion.
- Campaign management will remain in another product.
FAQ
Is SendGrid or Mailgun better for a B2B SaaS?
SendGrid is the stronger fit when one vendor family must cover application mail and a campaign program. Mailgun is the stronger fit when engineering needs API delivery, inbound routes, validation and log controls. Decide which team owns contacts, routes, suppression and event processing before comparing the price.
What does SendGrid list for 50,000 emails?
SendGrid lists Email API Essentials at $19.95 per month for the 50,000-email selection. It also lists Marketing Campaigns Basic at $15 per month for 5,000 contacts and up to 15,000 emails per month, which is a separate product and allowance.
What does Mailgun list for 50,000 emails?
Mailgun lists Foundation at $35 per month for 50,000 emails after the first month. Foundation lists five days of log retention and extra emails from $1.30 per 1,000. Mailgun lists Scale at $90 per month for 100,000 emails.
Does Mailgun receive inbound email?
Yes. Mailgun provides routes and inbound parsing so incoming messages can be forwarded to an endpoint according to address, domain or matching rules. Treat that endpoint as internet-facing application ingress: verify requests, limit attachments, prevent loops and keep authorization in your own service.
Does SendGrid include marketing campaigns in Email API pricing?
No. SendGrid presents Marketing Campaigns as a separate product with its own contact limits, monthly-send allowances and plans. Model campaign contacts and sends independently from Email API delivery, and document how consent and suppression are shared.
Which provider has longer listed logs?
Mailgun lists one day on Free and Basic, five days on Foundation and 30 days on Scale. SendGrid’s practical retention depends on the selected account and configuration, so define an internal event-export policy rather than relying on a provider screen as the only history.
Can either provider validate email addresses?
Mailgun lists email validation through Mailgun Optimize, including real-time and bulk paths. SendGrid can be evaluated with an additional validation product path. In either case, validation does not replace permission, unsubscribe handling or suppression.
How do we migrate from SendGrid to Mailgun?
Inventory domains, templates, API and SMTP clients, webhooks, suppression groups, campaign contacts and inbound routes. Verify authentication and region choices, rebuild templates, rehearse routes and ramp traffic by message class. Compare delivery events with your internal ledger before revoking the old credentials.
How do dedicated IPs differ?
SendGrid lists dedicated IPs on Email API Pro. Mailgun lists a dedicated IP with qualifying Scale configurations and lists additional IPs at $59 per IP per month. Both require authentication, stable volume, warm-up and daily reputation monitoring.