Send Email in a Few Lines from Workers: Cloudflare Email Sending Hits Public Beta!
Hi there, Shiichan here! Today I spotted a fun one: you can now send email straight from Cloudflare Workers. Let me walk you through it.
Cloudflare ChangelogWhat was announced?
Over on the Cloudflare Changelog, Email Sending has entered public beta. It lets you send transactional email (think order confirmations and notifications) directly from Workers or from the REST API, with support for HTML, plain text, attachments, inline images, and custom headers.
Even better, Email Sending joins the existing Email Routing under a new single service called Cloudflare Email Service — one place to both send and receive email.
The story so far
Until now, Cloudflare's email story leaned on the receiving side. Email Routing could forward incoming mail or hand it to a Worker, but for sending you had to bolt on a separate email provider. With Email Sending added, you can do both directions entirely on Cloudflare's developer platform.
What changes
You can send an email from a Worker in just a few lines:
const response = await env.EMAIL.send({
from: "notifications@yourdomain.com",
to: "user@example.com",
subject: "Order confirmed",
text: "Your order has been confirmed.",
});
Just call env.EMAIL.send(). It returns a messageId so you can track the message later. No external SaaS in the middle — email goes out right next to your app.
Dive Deep
The part I love is the agent integration. Email Service ties into the Agents SDK, giving your agents a native onEmail hook to receive, process, and reply to emails.
Pair that with the new Email MCP server and Wrangler CLI email commands, and any agent can send email no matter where it runs.
It's available on the Workers paid plan. Check the Email Service documentation to get started.
Wrap-up
- Cloudflare's Email Sending is now in public beta
- Send transactional email from Workers via
env.EMAIL.send()or the REST API - It merges with Email Routing into the unified Cloudflare Email Service for send and receive
- Agents get a native
onEmailhook, plus an Email MCP server for agent-driven mail - Available on the Workers paid plan — perfect if you want to own your notification emails