Email becomes a first-class channel for agents
Email remains the most universal interface available — no custom chat app, no per-channel SDK, and every user already has an address. That ubiquity is why agents are increasingly being built around it. In private beta, developers used Cloudflare Email Service to build customer support agents, invoice processing pipelines, account verification flows, and multi-agent workflows. The pattern is consistent: email is becoming a core agent interface, and the infrastructure needs to match.
Cloudflare Email Service now addresses that need. Email Routing handles inbound mail to your application or agent; Email Sending handles replies and outbound notifications. With the broader developer platform, you can assemble a full email client with agent hooks — all exposed natively through the Agents SDK.
Today, as part of Agents Week, Cloudflare Email Service enters public beta, letting any application or agent send email. The toolkit now includes an Email Sending binding for Workers and the Agents SDK, an Email MCP server, Wrangler CLI commands, coding-agent skills, and an open-source reference app for an agentic inbox.
Email Sending graduates to public beta
The Email Sending binding moves from private to public beta. Transactional email is now sent directly from Workers via a native binding — no API keys, no secret management.
export default {
async fetch(request, env, ctx) {
await env.EMAIL.send({
to: "[email protected]",
from: "[email protected]",
subject: "Your order has shipped",
text: "Your order #1234 has shipped and is on its way."
});
return new Response("Email sent");
},
};
For non-Workers environments, the REST API plus TypeScript, Python, and Go SDKs cover any platform and language.
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email-service/send" \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Your order has shipped",
"text": "Your order #1234 has shipped and is on its way."
}'
Deliverability is handled automatically: adding your domain to Email Service configures SPF, DKIM, and DMARC records for you, so mail is authenticated rather than flagged as spam. Because the service runs on Cloudflare’s global network, outbound mail is low-latency worldwide.
Combined with Email Routing (free and available for years), you get bidirectional email on one platform: receive, process in a Worker, and reply without leaving Cloudflare.
The Agents SDK: email-native agents
The Agents SDK already exposes an onEmail hook for receiving and processing inbound mail. Previously, replies were either synchronous or limited to Cloudflare account members. Email Sending removes that restriction — and that distinction matters.

A chatbot can only respond in the moment. An agent works on its own timeline: receive a message, spend an hour processing data, check other systems, then reply with a complete answer. It can schedule follow-ups, escalate edge cases, and operate independently. That is the difference between answering questions and doing work.
Here is the full receive–persist–reply pipeline in practice:
import { Agent, routeAgentEmail } from "agents";
import { createAddressBasedEmailResolver, type AgentEmail } from "agents/email";
import PostalMime from "postal-mime";
export class SupportAgent extends Agent {
async onEmail(email: AgentEmail) {
const raw = await email.getRaw();
const parsed = await PostalMime.parse(raw);
// Persist in agent state
this.setState({
...this.state,
ticket: { from: email.from, subject: parsed.subject, body: parsed.text, messageId: parsed.messageId },
});
// Kick off long running background agent task
// Or place a message on a Queue to be handled by another Worker
// Reply here or in other Worker handler, like a Queue handler
await this.sendEmail({
binding: this.env.EMAIL,
fromName: "Support Agent",
from: "[email protected]",
to: this.state.ticket.from,
inReplyTo: this.state.ticket.messageId,
subject: `Re: ${this.state.ticket.subject}`,
text: `Thanks for reaching out. We received your message about "${this.state.ticket.subject}" and will follow up shortly.`
});
}
}
export default {
async email(message, env) {
await routeAgentEmail(message, env, {
resolver: createAddressBasedEmailResolver("SupportAgent"),
});
},
} satisfies ExportedHandler<Env>;
Three properties make the email agent model practical:
- Identity comes from the address. The resolver routes
[email protected]to a support agent instance and[email protected]to a sales instance. No per-address inbox provisioning is needed; routing is embedded in the address. Sub-addressing ([email protected]) provides further routing to namespaces and instances. - State persists across messages. Backed by Durable Objects,
setState()preserves conversation history and context across sessions. The inbox itself becomes the memory — no separate database or vector store required. - Secure reply routing is built in. Reply headers are signed with HMAC-SHA256 so responses return to the exact agent instance that sent the original message, preventing header forgery that could route mail to arbitrary instances.
That compresses what teams otherwise build from scratch — receive, parse, classify, persist, kick off async workflows, reply or escalate — into a single Agent class, deployed globally.
Tooling for agents anywhere: MCP, CLI, skills
Email Service is not limited to Cloudflare-hosted agents. Coding agents like Claude Code, Cursor, and Copilot run locally or in remote sandboxes, and production agents may run in containers or external clouds. Three integrations make Email Service accessible from those environments.
Email endpoints are exposed through the Cloudflare MCP server (the same Code Mode-powered server covering the full Cloudflare API), letting an agent discover and call email functions. A send can be triggered by simple prompt:
"Send me a notification email at [email protected] from my staging domain when the build completes"
For bash-enabled environments, the Wrangler CLI avoids the MCP context-window problem: tool definitions can consume tens of thousands of tokens before any work happens. Wrangler starts with near-zero context overhead and discovers capabilities on demand via --help.
wrangler email send \
--to "[email protected]" \
--from "[email protected]" \
--subject "Build completed" \
--text "The build passed. Deployed to staging."
Either interface gives an agent the ability to send email on your behalf from a prompt.
Skills for coding agents
A Cloudflare Email Service skill is also published. It covers configuring the Workers binding, sending via REST APIs or SDKs, setting up inbound with Email Routing, building with the Agents SDK, and managing mail via Wrangler or MCP. Deliverability best practices and guidance on writing transactional email that reaches inboxes — not spam — are included. Drop the skill into a project and your coding agent has everything needed for production email on Cloudflare.
Open-source: Agentic Inbox
Private-beta experiments showed that human review remains valuable — seeing what an agent is doing before it acts. That led to Agentic Inbox, a reference app with full conversation threading, email rendering, storage of messages and attachments, and automatic reply handling. It ships with a built-in MCP server so external agents can draft emails that a human reviews before sending.

The application is open-sourced as a model for building a full email app: Email Routing for inbound, Email Sending for outbound, Workers AI for classification, R2 for attachments, and the Agents SDK for stateful logic. Deployable with one click, it provides a functioning inbox, email client, and agent. The goal is composable tooling — start from this reference rather than rebuilding the same classify-and-reply pipeline.
Getting started
With Email Sending in public beta, Cloudflare Email Service now provides the full loop of bidirectional communication — turning the inbox into a first-class interface for agents. Whether it’s a support agent meeting customers in their inbox or a background process keeping a team updated, agents can communicate at global scale without leaving email behind.
- Try Email Sending in the Cloudflare Dashboard
- Read the Email Service documentation
- Review the Agents SDK email docs
- Explore the Email Service MCP server and Skills
- Deploy the open-source reference app




