Migrate from Resend.
Same developer-first DX. Same disclosure-based AUP. New: typed reply events, native injection scanning, per-agent reputation, MCP-native distribution. ~30 minutes of changes, mostly inbound-side.
Send + receive, side by side.
Your Resend send and inbound code, and the Mails.ai code that replaces it.
// Resend — send, then a webhook plus a second call for each reply's body
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_KEY);
await resend.emails.send({
from: "hello@yourcompany.com",
to: "user@example.com",
subject: "Demo",
html: "<p>...</p>",
});
// The email.received webhook carries metadata only — fetch the body, then parse it.
app.post("/webhook/inbound", async (req, res) => {
const { email_id } = req.body.data;
const { data: email } = await resend.emails.receiving.get(email_id);
const intent = await myClassifier(email.text); // your own LLM call
const entities = await myEntityExtractor(email.text); // your own LLM call
// ...
});// Mails.ai — send + typed reply event
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: "...",
});
// Inbound arrives pre-scanned as a typed reply event.
agent.onReply((event) => {
// event.injection_score => 0.02
// event.sender_reputation => 0.85
});Introduction
Resend handles the send side well. Moving to mails.ai keeps that. What changes is the reply side. Each reply comes back with its injection score and the sender’s reputation pre-computed.
Jump ahead
You keep what Resend got right. You stop doing the inbound work yourself.
- Send-side is a near-drop-in. SDK shape is similar; method names differ. Deliverability holds — a live send scores 10/10 on mail-tester (SPF/DKIM/DMARC pass, not blocklisted).
- Inbound goes from raw → typed. Each reply arrives with
event.injection_scorepre-computed, and first-contact mail getsevent.intentonce you enable classification on the agent. - Pricing is parallel at low volume, beats Resend on parses at scale. Pro $20 = 50,000 emails + 50,000 inbound replies (Resend Pro $20 = 50K emails, received mail included).
- Both are transactional-email AUPs — send to recipients you have a relationship with. We modeled ours on theirs.
What maps to what.
Key differences
- Sending. Same shape; add the agent field (the agent's name or agt_ id) on Mails.ai for per-agent reputation.
- Domains. Same records-only model as Resend: add the returned SPF/DKIM/DMARC records at your own registrar, no nameserver move, then verify. Agents on a verified domain send as agent@yourcompany.com. The shared address (hello.yourcompany@send.mails.ai) stays available with zero DNS setup.
- Inbound. Resend's webhook carries metadata only, so each reply needs a second call for its body. A Mails.ai event carries the reply text and its injection score — no parsing in your code.
- Audiences. Resend Marketing is a separate product. Mails.ai is single-product transactional API + agent inbox primitive. If you use Resend Audiences for broadcast, keep using it; Mails.ai doesn't compete on broadcast.
- Billing. Resend counts received mail toward your sending quota. Mails.ai gives inbound replies their own allowance, so a busy inbox never eats into your emails.
| Name | Resend | Mails.ai |
|---|---|---|
| Sending | POST /emails | POST /v1/ |
| Domains | GET /domains | GET/ |
| Inbound | Inbound webhook (metadata) + GET /emails/ | GET /v1/ |
| Audiences | GET /audiences | (n/ |
| Billing | Stripe billing, monthly plans only | Stripe billing, monthly or yearly (two months free) |
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.
The questions engineers actually ask.
Will my domain verification carry over?
You re-verify once, the same way you did on Resend: POST /v1/domains returns SPF, DKIM and DMARC records to add at your registrar, then /verify checks them live. Records-only — no nameserver move, and your existing Resend records can stay in place during a dual-run. Agents created on the verified domain send as agent@yourcompany.com, DKIM-signed for your domain. One caveat worth knowing up front: custom-domain sends currently ride our own sending infrastructure, which cannot yet reach Outlook/Hotmail recipients — shared-subdomain sends are unaffected.
Can I keep using Resend for broadcast and Mails.ai for transactional?
Yes — they're different products. Resend Marketing handles audience broadcasts; Mails.ai handles agent-triggered transactional and inbox automation. Keep both; route per use case.
What about the disclosure / unsub rules?
Same as Resend's AUP — every send must include a valid sender address, your company name, an explicit disclosure of why you're contacting the recipient, and an unsubscribe mechanism honored within 7 days. Organizational addresses only (not personal). Auto-suspension at 0.3% complaint rate kicks in regardless. We modeled our AUP on Resend's because we like how they handle it.
Can I evaluate Mails.ai without paying — staying under the 3K free-tier cap?
Yes — Resend's free tier is 3K emails a month and ours is 3,000 emails + 3,000 inbound replies, so a dual-run evaluation fits inside the free tier on both sides. As you scale, Mails.ai Pro $20 = 50,000 emails + 50,000 inbound replies (Resend Pro $20 = 50K emails, received mail included), so the value-add is the included parse capacity for the same monthly dollar.
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
