Loading...
Loading...
Send and receive transactional emails with Cloudflare Email Service (Email Sending + Email Routing). Use when building email sending (Workers binding or REST API), email routing, Agents SDK email handling, or integrating email into any app — Workers, Node.js, Python, Go, etc. Also use for email deliverability, SPF/DKIM/DMARC, wrangler email setup, MCP email tools, or when a coding agent needs to send emails. Even for simple requests like "add email to my Worker" — this skill has critical config details.
npx skill4agent add cloudflare/skills cloudflare-email-service@cloudflare/workers-types| Source | How to retrieve | Use for |
|---|---|---|
| Cloudflare docs | | API reference, limits, pricing, latest features |
| REST API spec | | OpenAPI spec for the Email Sending REST API |
| Workers types | | Type signatures, binding shapes |
| Agents SDK docs | Fetch | Email handling in Agents SDK |
npx wrangler email sending listnpx wrangler email sending enable userdomain.comsend_emailwrangler.jsoncnpm ls postal-mime| I want to... | Path | Reference |
|---|---|---|
| Send emails from a Cloudflare Worker | Workers binding (no API keys needed) | sending.md |
| Send emails from an AI agent built with Cloudflare Agents SDK | | sending.md |
| Send emails from an external app or agent (Node.js, Go, Python, etc.) | REST API with Bearer token | rest-api.md |
| Send emails from a coding agent (Claude Code, Cursor, Copilot, etc.) | MCP tools, wrangler CLI, or REST API | cli-and-mcp.md |
| Receive and process incoming emails (Email Routing) | Workers | routing.md |
| Set up Email Sending or Email Routing | | cli-and-mcp.md |
| Improve deliverability, avoid spam folders | Authentication, content, compliance | deliverability.md |
wrangler.jsoncenv.EMAIL.send()fromnpx wrangler email sending enable yourdomain.com// wrangler.jsonc
{ "send_email": [{ "name": "EMAIL" }] }const response = await env.EMAIL.send({
to: "user@example.com",
from: { email: "welcome@yourdomain.com", name: "My App" },
subject: "Welcome!",
html: "<h1>Welcome!</h1>",
text: "Welcome!",
});POST https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/sendfromaddressemail{ "address": "...", "name": "..." }replyToreply_to{ delivered: [], permanent_bounces: [], queued: [] }messageId| Mistake | Why It Happens | Fix |
|---|---|---|
Forgetting | Email Service uses a binding, not an API key | Add |
| Sending from an unverified domain | Domain must be onboarded onto Email Sending before first send | Run |
Reading | The raw stream is single-use — second read returns empty | Buffer first: |
Missing | Some email clients only show plain text; also helps spam scores | Always include both |
| Using email for marketing/bulk sends | Email Service is for transactional email only | Use a dedicated marketing email platform for newsletters and campaigns |
| Forwarding to unverified destinations | | Run |
| Testing with fake addresses | Bounces from non-existent addresses hurt sender reputation | Use real addresses you control during development |
| Hardcoding API tokens in source code | Tokens in code get committed and leaked | Use environment variables or Cloudflare secrets |
Ignoring the | The | Verify the domain first, then send from |
Using | REST API uses | Use |
Using | REST API uses snake_case field names | Use |
email()