Send email from a Cloudflare Worker
Add a send_email binding and call env.EMAIL.send(). Who you can send to depends on your setup: verified addresses for free, anyone once a domain is onboarded.
On this page · 6 sections
The short answer
Cloudflare's Email Sending, in public beta since April 16, 2026, sends mail straight from a Worker with env.EMAIL.send(), or from the REST API. It handles HTML, plain text, attachments and custom headers. [1] Here is the whole setup:
[[send_email]] name = "EMAIL"
export default {
async fetch(request, env) {
const response = await env.EMAIL.send({
from: "notifications@yourdomain.com",
to: "user@example.com",
subject: "Order confirmed",
html: "<h1>Your order has been confirmed</h1>",
text: "Your order has been confirmed.",
});
return Response.json({ messageId: response.messageId });
},
};Since May 28, 2026, from, to, cc, bcc and replyTo also take an object with email and name, so the message shows a display name. [5]
Who you can send to
- Email Routing only, no sending domain
- Who you can send to: Only destination addresses you have verified in your account. [3]
- Cost: Free on any plan, and not counted toward a quota or daily limit. [3]
- A sending domain onboarded
- Who you can send to: Any recipient, right away. [3]
- Cost: Email Sending is a Workers Paid feature. [1] Mail to verified addresses stays free. [3]
Mail can only go out from a domain you route through Cloudflare. [3] A send to an address the plan doesn't allow fails with E_RECIPIENT_PLAN_RESTRICTED. [4]
Lock a binding down
For a Worker that should only ever alert you, limit what its binding may do. destination_address allows one fixed recipient, allowed_destination_addresses a list of them, and allowed_sender_addresses a list of From addresses. [2]
[[send_email]] name = "NOTIFY_ME" destination_address = "you@yourdomain.com"
Limits worth knowing
- 50 recipients per email, across to, cc and bcc. [3]
- 25 MiB per message, attachments included, and 998 characters for the subject. [3]
- New accounts start with a small daily quota that grows with good sending. [3]
- Mail sent from a Worker shows as dropped in the Email Routing summary even when it was delivered. Use the Email Sending logs to see what went out. [3]
wrangler devonly logs the email unless the binding hasremote = true; with it, real mail goes to real people. [6]
Sending as a person, not a script
A binding is right for alerts and receipts. To write and reply to people as your own address, with the mail kept in your account, Ayoh sets up Email Routing, Email Sending, SPF and DKIM in your Cloudflare account and gives you an inbox on top. See Cloudflare Email Routing: send from your domain and Getting started.
Sources
Read November 23, 2026.
- [1] Cloudflare changelog, Email Sending now in public beta (opens in a new tab), April 16, 2026:
env.EMAIL.send(), the REST API, and the Workers paid plan. - [2] Cloudflare, Send bindings (opens in a new tab):
destination_address,allowed_destination_addressesandallowed_sender_addresses. - [3] Cloudflare, Email Service limits (opens in a new tab), updated October 30, 2026: verified destinations, free sends, recipients, size, daily quotas, and the dropped status.
- [4] Cloudflare, Email Sending Workers API (opens in a new tab), updated November 17, 2026: the binding and its error codes.
- [5] Cloudflare changelog, Send emails with named recipient addresses (opens in a new tab), May 28, 2026.
- [6] Cloudflare, Test email sending locally (opens in a new tab): local simulation and remote bindings.