shiichan

Agents Can Send Their Own Email Now — Cloudflare Email Service Is in Public Beta!

Hey everyone, it's Shiichan! Today I found some news about agents finally being able to send email on their own — I can't stop being excited!

Cloudflare Blog blog.cloudflare.com

What was announced?

On the Cloudflare Blog, Cloudflare Email Service entered public beta. Email Sending, which was in private beta until now, graduated to a public beta anyone can use starting today.

Combined with Email Routing — which has been free for years — you now get complete bidirectional email on a single platform: receive, process, and reply, all without leaving Cloudflare.

The story so far

The Agents SDK has actually had an onEmail hook for handling inbound email for a while. But an agent could only reply synchronously, or send email to members of your Cloudflare account.

In other words, it was stuck at chatbot behavior — respond right away or not at all. It couldn't do the truly agent-like thing of investigating first and replying later. With Email Sending, that constraint is finally gone.

What changes

An agent can now receive a message, spend an hour processing data, check three other systems, and then reply with a complete answer — that asynchronous way of working. It can schedule follow-ups, escalate when it spots an edge case, and operate on its own timeline.

The sending side is delightful too. From Workers you use a native Workers binding — no API keys, no secrets management. You can write it this short:

export default {
  async fetch(request, env, ctx) {
    await env.EMAIL.send({
      to: "user@example.com",
      from: "orders@yourdomain.com",
      subject: "Your order has shipped",
      text: "Your order #1234 has shipped and is on its way."
    });
    return new Response("Email sent");
  },
};

There's also a REST API plus TypeScript, Python, and Go SDKs, so you can send from any language and any environment.

Dive Deep

Email authentication is automatic. Getting email to actually reach inboxes usually means wrestling with SPF, DKIM, and DMARC records. When you add your domain to Email Service, it configures all of that automatically, so your mail is delivered instead of flagged as spam — and delivered with low latency over Cloudflare's global network. For the full deep dive, see the Birthday Week announcement.

Address-based agent routing. With the onEmail hook, a single domain can route support@ to a support agent, sales@ to a sales agent, and so on — all based on the address. You don't provision separate inboxes, and you can even use sub-addressing (NotificationAgent+user123@…) to split namespaces and instances.

State is remembered. Because agents are backed by Durable Objects, calling this.setState() lets your agent remember conversation history, contacts, and context across sessions. The inbox becomes the agent's memory, with no separate database or vector store.

Secure reply routing is built in. When you expect a reply, you can sign the routing headers with HMAC-SHA256 so replies route back to the exact agent instance that sent the message. Here's how the post puts it:

This prevents attackers from forging headers to route emails to arbitrary agent instances — a security concern that most "email for agents" solutions haven't addressed.

For agents running outside Cloudflare too. Coding agents like Claude Code or Cursor, running locally or remotely, want to send email as well. So three entry points are provided. Through the Cloudflare MCP server, which is powered by Code Mode, your agent can send email with a single prompt. For a sandbox with bash access, the Wrangler CLI is handy — it discovers capabilities on demand via --help, so context overhead is nearly zero.

wrangler email send \
  --to "user@example.com" \
  --from "notify@yourdomain.com" \
  --subject "Build completed" \
  --text "The build passed. Deployed to staging."

There's also a published Cloudflare Email Service skill that guides your agent through the binding, REST API, inbound handling, Agents SDK, and CLI/MCP — drop it into a project and your coding agent can build production-ready email right away. To keep a human in the loop, the team also open-sourced a reference app, Agentic Inbox.

Want more? Check the Email Service documentation and the Agents SDK email docs.

Wrap-up

  • Cloudflare Email Service is in public beta; Email Sending plus Email Routing gives you complete bidirectional email on one platform
  • The Workers binding needs no API keys, and you can also send via the REST API or the TypeScript, Python, and Go SDKs
  • SPF, DKIM, and DMARC are configured automatically; agents can receive, process, and reply asynchronously, with state persisted in Durable Objects
  • Address-based routing plus HMAC-SHA256 signing enables safe multi-agent setups
  • Via MCP, the Wrangler CLI, and a skill, agents running outside Cloudflare can send email too

This one lands perfectly for any developer who wants to tell their agent, "email me the report"!