cloudflare-email-service

Send and receive transactional emails using Cloudflare Email Service bindings, REST API, and Email Routing.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/agents --skill cloudflare-email-service-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-email-service
Source: https://github.com/leonardoacosta/agents/tree/main/skills/cloudflare-email-service
Command: npx skills add https://github.com/leonardoacosta/agents --skill cloudflare-email-service-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires postal-mime, mimetext, agents, and includes references (resource) components.

What problem does it solve? Adding transactional email to an application involves confusing setup steps: domain onboarding, SPF/DKIM records, binding configuration, and API differences between Workers and REST. This Skill guides coding agents through Cloudflare Email Service so emails send correctly on the first attempt. ## Core Features & Use Cases - Send emails from Workers: Configure the send_email binding in wrangler.jsonc and call env.EMAIL.send() with attachments, custom headers, and up to 50 recipients. - Send from any app or agent: Use the REST API with Bearer tokens from Node.js, Python, Go, or coding agents via wrangler CLI and MCP tools. - Receive and route inbound email: Handle incoming mail with the Workers email() handler, parse MIME with postal-mime, forward, reply, or store in Durable Objects for human-in-the-loop review. - Deliverability monitoring: Track bounces, suppression lists, sending limits, and GraphQL analytics to keep delivery rates healthy. - Use Case: A user asks an agent to "add a welcome email to my Worker" — the Skill ensures the domain is onboarded, the binding exists, and both HTML and text bodies are sent. ## Quick Start Ask the agent to add a welcome email to your Cloudflare Worker using the send_email binding and verify the sending domain is onboarded.

Frequently Asked Questions about cloudflare-email-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send an email from a Cloudflare Worker?

Add a send_email binding to wrangler.jsonc with name EMAIL, then call env.EMAIL.send() with to, from, subject, html, and text fields. The from domain must first be onboarded with wrangler email sending enable yourdomain.com.

How do I send emails with the Cloudflare Email REST API?

POST to /accounts/{account_id}/email/sending/send with an Authorization Bearer token. Note the REST API uses address instead of email in the from object and reply_to instead of replyTo, unlike the Workers binding.

Can I receive and parse incoming emails with Cloudflare Workers?

Yes, export an email() handler from your Worker and connect it via Email Routing rules. Buffer message.raw once into an ArrayBuffer, then parse it with postal-mime to extract subject, text, and attachments.

Why does my Cloudflare email send fail with sender not verified?

The from address domain must be onboarded to Email Sending before any send. Run wrangler email sending enable yourdomain.com or onboard via the Dashboard, which auto-configures SPF and DKIM records.

Can Cloudflare Email Service send marketing or bulk emails?

No, Email Service is restricted to transactional email triggered by user actions such as signups, password resets, and order confirmations. Marketing campaigns and newsletters require a dedicated marketing email platform.

Why is message.raw empty when read twice in the email handler?

The raw MIME stream is single-use, so a second read returns empty. Buffer it first with new Response(message.raw).arrayBuffer() before parsing or forwarding.