Most email APIs are pipes. You hand them a message, they deliver it, and that is the end of their interest. That is fine for a password reset, which nobody answers. It stops working the moment someone replies, and for an AI agent it never worked at all, because an agent's work lives in the replies.
This is a guide to the difference between sending email and having a mailbox, and to the ways you can give an app or an agent one in 2026.
A send API is a pipe
A sending service takes a message over HTTP, delivers it and reports what happened: delivered, bounced, opened. Replies are not its business. They go wherever the Reply-To header points, which is usually a no-reply address, a person's inbox somewhere else, or an inbound webhook.
Inbound webhooks look like the answer, and they are a start. SendGrid's Inbound Parse, Postmark's inbound stream and Mailgun's routes post the incoming message to an endpoint you run, and Amazon SES drops it into an S3 bucket or a Lambda function. What arrives is one message at a time. Storing it, threading it with the mail you sent, searching it later, filtering spam, keeping attachments and sending the next reply from the right address are all left to your code. Resend has started to close that gap: it now hosts inboxes with threads, labels and drafts, three on each plan and $1 a month for every one after that, as our Resend pricing guide sets out. Our comparisons with SendGrid, Postmark, Resend and Amazon SES go through each one.
What a mailbox adds
A mailbox is the part every one of those pipes leaves out:
- It keeps the conversation. Messages are stored, and a reply joins its thread through the Message-ID, In-Reply-To and References headers that every mail program writes, as RFC 5322 describes.
- It replies from the same address. The person answers the address that wrote to them, and the answer comes back to the same thread instead of disappearing into a no-reply box.
- It can be searched. By sender, subject, date or the words in the body, which is exactly what an agent does before it answers anything.
- It has state. Read and unread, labels, archive, so a program and a person can share the work without doing it twice.
- It opens in any mail app. IMAP and JMAP are open standards, so the same mailbox shows up in Apple Mail or Thunderbird for the person who wants to check what the agent did.
- It has an identity receivers trust. Mail from a domain with SPF, DKIM and DMARC in place is not mistaken for a forgery. Our guide to SPF, DKIM and DMARC explains how that works.
Why agents need one
Look at the jobs people actually give an agent:
- Sign up for a service and read the confirmation code it emails back.
- Write to a supplier, then act on the answer that arrives two days later.
- Take in invoices, receipts or support requests sent to an address, and file each one.
- Follow up when nobody has answered.
Every one of them starts or finishes with mail arriving. An agent with only a send API can open conversations it will never hear the end of.
Four ways to give an agent a mailbox
A Gmail or Microsoft 365 account
These are real mailboxes, and the APIs are mature. But the agent either borrows a person's account or needs a paid seat of its own, and the Gmail API scopes that can read a whole mailbox are restricted: your app has to pass Google's OAuth verification, and a security assessment as well if it stores or passes on that data.
IMAP and SMTP against any provider
Every language has a library, and it works with nearly any provider. It is also a session protocol from another era: you hold a connection open with IDLE or poll for changes, manage app passwords, and build your own idea of a thread on top of folders.
Inbound webhooks on a sending API
Quick to set up and cheap to run, and you write the mailbox yourself: storage, threads, search, spam handling and replies from the right address.
A mailbox built for programs
An API where receiving, storing, threading and waiting for mail are the product itself, and where an agent connects with its own credentials and limits. AgentMail is one, with an inbox per agent created through its API (we compare it with ours here). Nextmail is another, and it is the one we build.
How Nextmail does it
- Every address is already a mailbox. With catch-all on, every address on your domain receives, including the ones you never created, so an agent can hand a service
[email protected]without a setup call first. - It tells your code when mail arrives. Signed webhooks fire when mail comes in, and live events stream every change to a mailbox over one open connection, then resume where they left off after a disconnect.
- It waits for you.
GET /threads/waitholds the request open for up to 60 seconds and answers with the first message that matches a sender, a subject or an address. That is how an agent waits for a sign-in code, and over MCP it is thewaitForEmailtool.
curl "https://api.nextmail.sh/threads/[email protected]&subject=code" \ -H "Authorization: Bearer $API_KEY"- Mail only a program reads can skip the inbox. An address can post straight to your server instead, with the text, the HTML and every attachment.
- Agents connect with limits. Claude Code, Codex, Cursor and ChatGPT connect over the Model Context Protocol after a person approves them in the browser, for one workspace, a set of permissions, some or all addresses and an end date. An agent approved as read-only does not even see the tool that sends. What an agent can reach has the details.
claude mcp add --transport http nextmail https://api.nextmail.sh/mcp- People can check the work. The same addresses open in the web app, on iPhone and Android, and in any mail app over IMAP.
It is priced per workspace rather than per inbox, so a second agent does not add a second bill. Website is built this way: every site it makes for a business gets a working address, its mail lands in the owner's dashboard and replies stay in the thread.
Where to start
If all your app does is send receipts, a send API is enough. Once anything has to read a reply, give it a mailbox. The guide for AI agents shows an agent how to connect to Nextmail over MCP, the command line or the API, and the agents page shows what they do once they are in.
Google Workspace