Migrate from Mailgun.

Same SMTP shape on send. Different inbound — typed reply events instead of raw bodies. MCP-native distribution. Self-serve monthly or yearly plans. ~30 minutes of changes.

Send + receive, side by side.

Your Mailgun send and inbound code, and the Mails.ai code that replaces it.

Mailgun
// Mailgun — send + raw inbound webhook
const mg = require("mailgun-js")({ apiKey, domain });

mg.messages().send({
  from: "hello@yourcompany.com",
  to: "user@example.com",
  subject: "Demo",
  text: "...",
});

// Inbound webhook delivers raw body-plain, body-html, attachments
app.post("/inbound", (req, res) => {
  const { sender, subject, "body-plain": body } = req.body;
  // Classify intent + extract entities yourself
});
Mails.ai
// Mails.ai — typed reply event with its injection score pre-computed
import { mails } from "@mailsai/sdk";
const agent = mails.agent("hello"); // sends from hello.yourcompany@send.mails.ai

await agent.send({ to: "user@example.com", subject: "Demo", body: "..." });

agent.onReply((event) => {
  // event.injection_score / sender_reputation
});

Introduction

Mailgun was built for developers in 2010. It’s still good at sending. But it hands you a raw email body and leaves you to parse it. Mails.ai does the parsing for you — security scores included.

Jump ahead

Four reasons.

Inbound webhooks go from raw → typed

Mailgun delivers body-plain / body-html / stripped-text and you classify. Mails.ai delivers each reply as an event with injection_score and sender_reputation pre-computed; first-contact mail also gets intent, entities and urgency once you turn classification on.

Native prompt-injection scanning on every inbound

Every inbound runs a six-category injection scanner. Mailgun has no equivalent — agent attack defense is 100% your responsibility there.

MCP-native distribution

npx @mailsai/mcp-server drops mails_send / mails_list_replies into Claude Code, Cursor, Cline. Mailgun has no MCP surface.

Self-serve signup

Mailgun Foundation $35/50K, Growth $80/100K. Mails.ai Pro $20/50K (emails + inbound replies) / Scale $99/250K (emails) + 500K (inbound replies). Scale is our largest self-serve plan.

What you gain by moving.

Typed reply events.

Stop regexing raw inbound bodies. Every inbound arrives with injection_score and sender_reputation pre-computed, and first-contact mail with intent, entities and urgency too when you enable classification.

Native prompt-injection scanning.

Every inbound runs a six-category injection scanner before reaching your agent. No third-party tool, no DIY guardrails.

MCP-native distribution.

npx @mailsai/mcp-server drops into Claude Code, Cursor, Cline, or any MCP-compatible runtime — your agent gets mails_send / mails_list_replies tools automatically.

Self-serve signup.

No Enterprise gate. No contact-sales tier. No sales team to call. The pricing page is the price — monthly, or yearly for two months free.

Lean cost structure.

Commodity infrastructure plus a small team, and no sales org to pay for.

Dual-run on the Free tier.

Same SMTP shape on the send side; typed reply events on the inbound side. Self-serve checkout, magic-link signup, no sales call. The Free tier (3,000 emails and 3,000 inbound replies a month) covers the dual-running phase.

Give your first agent an inbox

Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.

Get your API key