---
title: "Email as a mailbox: why AI agents need a real inbox"
description: "Most email APIs only send. What a real mailbox adds for apps and AI agents, the four ways to get one in 2026, and how much code each leaves you."
url: "https://nextmail.sh/blog/email-as-a-mailbox"
---

[Blog](https://nextmail.sh/blog.md)[AI](https://nextmail.sh/blog/tags/ai.md)

# Email as a mailbox: why AI agents need a real inbox

Most email APIs only send. What a real mailbox adds for apps and AI agents, the four ways to get one in 2026, and how much code each leaves you.

Benjamin Nextmail team

October 31, 2026 5 min read

TL;DR

- A send API delivers a message and forgets it. The reply goes to some other inbox, or to a webhook whose storing, threading and searching are left to your code.
- AI agents live in the replies: sign-up codes, answers from people, invoices and tickets that arrive at an address days later.
- A real mailbox keeps the thread, replies from the same address, can be searched, tells your code when mail arrives and lets you limit what an agent reaches.

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](https://nextmail.sh/blog/resend-pricing.md) sets out. Our comparisons with [SendGrid](https://nextmail.sh/compare/sendgrid.md), [Postmark](https://nextmail.sh/compare/postmark.md), [Resend](https://nextmail.sh/compare/resend.md) and [Amazon SES](https://nextmail.sh/compare/amazon-ses.md) 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](https://nextmail.sh/blog/spf-dkim-dmarc-explained.md) explains how that works.

## Why agents need one

Look at the jobs people actually give an agent:

1. Sign up for a service and read the confirmation code it emails back.
2. Write to a supplier, then act on the answer that arrives two days later.
3. Take in invoices, receipts or support requests sent to an address, and file each one.
4. 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](https://nextmail.sh/compare/agentmail.md)). Nextmail is another, and it is the one we build.

## How Nextmail does it

- **Every address is already a mailbox.** With [catch-all](https://nextmail.sh/docs/knowledge/addresses/catch-all.md) on, every address on your domain receives, including the ones you never created, so an agent can hand a service `signup-4821@example.com` without a setup call first.
- **It tells your code when mail arrives.** Signed [webhooks](https://nextmail.sh/docs/knowledge/developers/webhooks.md) fire when mail comes in, and [live events](https://nextmail.sh/docs/knowledge/developers/live-events.md) 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/wait` holds 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 the `waitForEmail` tool.

bash

```
curl "https://api.nextmail.sh/threads/wait?from=no-reply@service.example&subject=code" \  -H "Authorization: Bearer $API_KEY"
```

- **Mail only a program reads can skip the inbox.** An address can [post straight to your server](https://nextmail.sh/docs/knowledge/developers/webhook-routing.md) 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](https://nextmail.sh/docs/mcp/scope.md) has the details.

bash

```
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](https://nextmail.sh/docs/knowledge/addresses/mail-apps.md) over IMAP.

It is priced per workspace rather than per inbox, so a second agent does not add a second bill. [Website](https://nextmail.sh/customers/website.md) 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](https://nextmail.sh/docs/get-started/ai-agents.md) shows an agent how to connect to Nextmail over MCP, the command line or the API, and the [agents page](https://nextmail.sh/agents.md) shows what they do once they are in.

- [AI](https://nextmail.sh/blog/tags/ai.md)
- [Developers](https://nextmail.sh/blog/tags/developers.md)
- [Email API](https://nextmail.sh/blog/tags/email-api.md)

## References

1. 1 [RFC 5322: Internet Message Format](https://www.rfc-editor.org/rfc/rfc5322) IETF
2. 2 [RFC 9051: Internet Message Access Protocol (IMAP), Version 4rev2](https://www.rfc-editor.org/rfc/rfc9051) IETF
3. 3 [RFC 8621: The JSON Meta Application Protocol (JMAP) for Mail](https://www.rfc-editor.org/rfc/rfc8621) IETF
4. 4 [Choose Gmail API scopes](https://developers.google.com/workspace/gmail/api/auth/scopes) Google
5. 5 [Model Context Protocol](https://modelcontextprotocol.io/) Model Context Protocol

Keep reading

## Related articles

Oct 31, 2026 8 min read

### Best AI email clients for 2026: 8 apps compared

Eight AI email clients compared on what their AI does, the mail they work with and the price in 2026, from Nextmail and Superhuman to Gmail and Outlook.

Benjamin AI

Oct 31, 2026 5 min read

### SPF, DKIM and DMARC explained: how inboxes trust mail

What SPF, DKIM and DMARC each check, why alignment decides whether DMARC passes, and a safe order for moving a domain from p=none to p=reject.

Benjamin Deliverability

Oct 31, 2026 6 min read

### How to build your own email client on Nextmail

What you need to build your own email client on Nextmail: OAuth sign-in for your users, typed SDKs in seven languages, live events, webhooks and raw messages.

Arta Developers

Try it yourself

## Your email, on your own domain.

Nextmail puts your domains, sending and inbox in one place, with the full API on every plan, the free one included.

[Open mail](https://nextmail.sh/mail/inbox) [Get Started](https://nextmail.sh/signup.md)[All articles](https://nextmail.sh/blog.md)
