Email

env.EMAIL sends transactional email from your app — receipts, notifications, magic links — through a managed delivery service. There are no SMTP credentials or API keys to set up.

Sending

env.EMAIL is an attachable resource — ask your assistant to enable email (it runs attach_resource) and the binding is wired on your next deploy.
// api/notify.js
export default {
  async fetch(request, env, ctx) {
    await env.EMAIL.send({
      to: "customer@example.com",
      subject: "Your order shipped",
      html: "<h1>On its way!</h1><p>Tracking: ABC123</p>",
      text: "On its way! Tracking: ABC123",
    });
    return Response.json({ ok: true });
  },
};

Pass to, subject, and an html and/or text body. The platform attaches the sender and routing details for you.

Preview-safe by default

On a preview or branch deploy, email is automatically made safe: the recipient is rewritten to the deploying user, the subject is prefixed with [PREVIEW], and a banner is added to the body. Real recipients only receive mail from a production deploy — so testing a flow never emails your customers.

Limits

Sending is capped per app, per month, by plan, plus a per-app daily ceiling and a short-window rate limit to contain bugs and abuse. See Limits & quotas.

Auth emails (verification, password reset, 2FA codes) sent by env.AUTH go through this same channel — you don't call env.EMAIL yourself for those.