7 email inbox APIs for OTP and verification testing, compared (2026)
You have a signup flow, a password reset, or an AI agent that has to create an account somewhere. At some point a six-digit code lands in an inbox, and your test or your agent has to read it. This guide compares seven services that give you an inbox you can read from code, and says plainly which one fits which job.
Disclosure: we build MailFlat, one of the seven. We have tried to be fair: every price and limit below was checked on the vendor's own public page on 29 October 2026, and each section says where another tool is the better pick. Prices change, so follow the links before you buy.
The short answer
- Your test or agent signs up on a real third-party service (it needs a real address that receives real mail): MailFlat, Mailosaur, MailSlurp, testmail.app, Mailinator (Verified Pro and up) or AgentMail. Mailtrap's paid sandbox plans also give each sandbox an address.
- You only test emails your own app sends, in dev or staging: Mailtrap Email Sandbox. It catches your outgoing mail and never delivers it to real people.
- You want the code handed to you, no regex: MailFlat (
wait_for_otp()) or Mailosaur (codes extracted automatically). - You also test SMS codes: Mailosaur, MailSlurp or Mailinator.
- Your agent holds long email conversations, not just codes: AgentMail or MailFlat.
How we compared
We looked at the things that decide whether a verification test is reliable:
- Real inbound mail. Does the address receive mail from any sender on the internet, or only mail your own app sends to a sandbox?
- Waiting and extraction. Can you block until the email arrives, and does the service pull the code out for you?
- Free plan. Is it a working plan or a trial?
- Entry price for a paid plan, as published.
- Fit for AI agents. MCP server, agent SDKs, permanent addresses an agent can keep.
Comparison table
| Service | Receives real mail | Wait and code helper | Free plan | Price for 5,000 emails a month |
|---|---|---|---|---|
| MailFlat | Yes | wait_for_otp() returns the code | 2,500 emails/mo, 10 inboxes, 1 custom domain | $5.99/mo |
| Mailosaur | Yes | Codes extracted automatically | 14-day trial | $20/mo, billed annually |
| MailSlurp | Yes | waitForLatestEmail + regex match | 250 emails/mo | $69/mo |
| testmail.app | Yes | Live query waits for a match | 100 emails/mo, 1-day retention | $9/mo, billed annually |
| Mailinator | Yes (public inboxes are readable by anyone) | API and webhooks on Verified Pro and up | Public inboxes, no API; Verified Pro with API | $79/mo, billed yearly |
| Mailtrap Email Sandbox | Free: only what your app sends to it. Basic and up: an address per sandbox | API to read captured mail | 50 test emails/mo | $34/mo, billed annually |
| AgentMail | Yes | Webhooks and websockets | 3 inboxes, 3,000 emails/mo | $20/mo |
The price column is the cheapest published plan that covers 5,000 emails a month, as of 29 October 2026. MailFlat counts received plus sent mail; the others count received or test emails.
1. MailFlat

What it is. Email infrastructure built for AI agents and test suites. Every inbox is a real, deliverable address on authenticated domains. The address is permanent and stays until you delete it. The messages clear themselves on a timer you choose, 2 hours on the free plan and up to 30 days on paid plans, so a test never inherits yesterday's mail and nothing piles up.
Why teams pick it
- The code in one call.
wait_for_otp()waits for the email and returns the code. No polling loop, no regex. Every message also carries itslinks, so a magic link or a verification URL is one attribute away. - Built for agents first. A full MCP server: open inboxes, wait for codes, send, reply in the same thread, even accept calendar invitations. Plus a LangChain toolkit and a Vercel AI SDK package, so the same tools work in GPT, Claude and LangChain agents.
- More than reading. Each inbox sends DKIM-signed mail and replies in the same thread, so an agent can finish a conversation, not only read a code.
- Your own domain on the free plan. Open inboxes like
bot@yourcompany.comwithout paying. MailSlurp, testmail.app and AgentMail do not include a custom domain on their free plans. - Private by default. Your addresses belong to your account; there are no public inboxes to guess. Turn on end-to-end encryption and the server only ever stores ciphertext.
- One inbox, many tests. Plus-addressing tags (
signup+checkout@...) land in the same inbox and stay filterable, and webhooks push new mail to your code. - Mail that actually arrives. Real SMTP on domains with SPF, DKIM and DMARC, and MTA-STS enforced, so signup emails from real services get delivered.
- The lowest price on this list for 5,000 emails a month: $5.99.
Python
TypeScript
Claude, Cursor or any MCP client
There is also an official Java SDK, and the docs have copy-paste guides for Playwright, Cypress, Selenium and pytest.
When another tool fits better
- You also need SMS codes: look at Mailosaur, MailSlurp or Mailinator.
- You need rendering previews across mail clients: Mailosaur or MailSlurp.
Pricing. Free: 2,500 emails a month (received plus sent), 10 saved inboxes and 1 custom domain. Pro starts at $5.99 a month for 5,000 emails, with longer retention and more inboxes. See pricing.
Best for: AI agents that sign up, verify and reply on real services, and test suites that want the code in one line, on a free plan you can actually use.
2. Mailosaur

What it is. A mature testing platform for email and SMS, aimed at QA teams.
Strengths
- Extracts verification codes for you: they appear in
message.html.codesandmessage.text.codes(docs). - SMS testing and email previews are available as separate solutions.
- Team features, SSO and SLAs on higher plans.
Limits
- No free plan beyond a 14-day trial.
- The entry plan is billed annually.
Pricing. Personal from $20 a month billed annually: 1 inbox with unlimited addresses, 15,000 inbound emails a month. Core from $50 a month billed annually.
Best for: QA teams that test email and SMS together and want codes extracted without regex.
3. MailSlurp

What it is. A broad email platform: testing, sending, deliverability checks and phone numbers.
Strengths
waitForLatestEmailblocks until mail arrives, andgetEmailContentMatchpulls a code out with a pattern you give it (docs).- Many integrations and SDKs, plus device rendering and inbox placement tests.
- Phone numbers for SMS on Pro and up, paid separately.
Limits
- The free plan receives 250 emails a month.
- No custom domains on Free or Starter.
Pricing. Free: 250 emails received a month. Starter $19.99 a month (2,500 received). Pro $69 a month (5,000 received).
Best for: teams that want testing, deliverability and SMS from one vendor.
4. testmail.app

What it is. A focused, developer-friendly test inbox service with JSON and GraphQL APIs.
Strengths
- A "live query" waits until a matching email arrives, so you do not poll (docs).
- Unlimited addresses and mailboxes on every plan.
- Low entry price.
Limits
- You parse the code out of the message yourself.
- The free plan keeps mail for 1 day and receives 100 emails a month.
- Custom domains start on the Unlimited plan.
Pricing. Free: 100 emails a month. Essential $9 a month billed annually ($12 monthly) for 10,000 emails. Pro $29 a month billed annually.
Best for: small teams that want a simple, cheap test inbox and are happy to write their own parser.
5. Mailinator

What it is. The best-known public inbox service, with private domains and an API on paid and verified plans.
Strengths
- Public inboxes need no signup at all, which is handy for a quick manual check.
- Private domains, an API, webhooks and routing rules on Verified Pro and up.
- SMS testing on Business and up, with phone numbers at extra cost.
Limits
- Public inboxes are readable by anyone who types the address, and the public plan has no API. Never use them for anything private (Mailinator docs).
- Paid plans are priced for teams.
Pricing. Public: free. Verified Pro: free after verification, 1 private domain, 2,000 emails a month. Business $79 a month billed yearly.
Best for: teams that want a private testing domain with high volume, and people who need a quick throwaway check by hand.
6. Mailtrap Email Sandbox
What it is. A safe catch-all for dev and staging. Your app sends through the sandbox's SMTP credentials instead of to real recipients, and you inspect what it sent.
Strengths
- Safe: nothing you send in testing reaches a real person.
- Tooling for checking the HTML, spam score and headers of your own emails.
- From the Basic plan, every sandbox gets its own address that accepts mail sent to it, including
+aliases (docs). - API access on every plan.
Limits
- The free plan has no sandbox address, so it only sees mail your own app sends through the sandbox: 50 test emails a month, 10 per sandbox.
- It is built around testing your own outgoing email. Receiving is a feature of the sandbox, not the center of the product.
- Volume is low for the price. Basic is $14 a month billed annually for 500 test emails, and each sandbox holds 50 at a time. For comparison, MailFlat's free plan includes 2,500 emails a month.
Pricing. Free: 50 test emails a month. Basic $14 a month billed annually ($17 monthly) for 500 test emails. Team $34 a month billed annually. Source: Mailtrap pricing, checked 29 October 2026.
Best for: testing the emails your own app sends, before they go live.
7. AgentMail

What it is. An email API built for AI agents that run their own inboxes and hold conversations.
Strengths
- SDKs, webhooks, websockets and an MCP server on every plan.
- Built specifically for agents that send, receive and reply to email.
- A generous free plan for trying it out.
Limits
- No custom domains on the free plan.
- More than you need if your job is only reading a code.
Pricing. Free: 3 inboxes, 3,000 emails a month. Developer $20 a month: 10 inboxes, 10,000 emails, 10 custom domains.
Best for: agents whose main job is two-way email conversations.
How to choose
If the email comes from your own app and you only want to look at it, use Mailtrap Email Sandbox. Its paid plans can also receive mail at a sandbox address.
If the email comes from a service you do not control (a signup, a magic link, a vendor's verification), you need a real inbox. Pick by what matters most:
- The code in one call, plus agent tooling: MailFlat
- Email and SMS together, enterprise QA: Mailosaur
- One vendor for testing, sending and deliverability: MailSlurp
- The lowest price, and you parse codes yourself: testmail.app
- A private testing domain at high volume: Mailinator
- Long agent conversations: AgentMail or MailFlat
Frequently asked questions
What is the difference between an email sandbox and a real test inbox?
A sandbox catches the mail your own app sends and never delivers it to real people. A real test inbox has an address on the internet, so it receives mail from any service, including signups on sites you do not control.
Which email testing API gives me the OTP code without regex?
MailFlat returns the code from wait_for_otp(), and Mailosaur exposes the codes it detects on each message. With MailSlurp and testmail.app you read the message and match the code with a pattern.
Can I run CI on a free plan?
Often, yes. As of 29 October 2026: MailFlat 2,500 emails a month, AgentMail 3,000, MailSlurp 250, testmail.app 100 with 1-day retention, Mailtrap Sandbox 50. Mailosaur offers a 14-day trial instead.
Are public Mailinator inboxes safe for tests?
Only for checks that contain nothing private. Anyone who types the address can read the inbox. Use a private domain for real work.
All product names and trademarks belong to their owners. Screenshots show public pricing pages and are used for comparison. If something here is out of date, tell us at support@mailflat.net and we will fix it.