Skip to content
Start here

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:

wrangler.toml
[[send_email]]
name = "EMAIL"
A Worker that sends one message
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]

wrangler.toml: a binding that can only email you
[[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 dev only logs the email unless the binding has remote = 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.