cloudflare-email-service

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

5|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/nuggocto/dotfiles --skill cloudflare-email-service-nuggocto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-email-service
Source: https://github.com/nuggocto/dotfiles/tree/main/opencode/skills/cloudflare-email-service
Command: npx skills add https://github.com/nuggocto/dotfiles --skill cloudflare-email-service-nuggocto

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Integrating transactional email into applications requires navigating Cloudflare Email Service's evolving APIs, domain onboarding, DNS authentication, and subtle differences between the Workers binding and REST API, where mistakes cause silent delivery failures. ## Core Features & Use Cases - Email Sending: Send transactional emails from Workers via the send_email binding, from external apps via the REST API, or from AI agents using the Agents SDK onEmail() and replyToEmail() methods. - Inbound Email Routing: Receive, parse, forward, reply to, or reject incoming emails with a Worker's email() handler and postal-mime parsing, including store-and-reply-later patterns with Durable Objects. - Deliverability Management: Configure SPF/DKIM/DMARC, monitor bounces and suppression lists, and query email analytics through the GraphQL API. - Use Case: Add a welcome email to a Cloudflare Worker by enabling the domain with wrangler email sending enable, adding the send_email binding, and calling env.EMAIL.send() with verified sender addresses. ## Quick Start Ask the agent to add email sending to your Cloudflare Worker using the send_email binding with a verified domain.

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 emails from a Cloudflare Worker?

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

What is the difference between the Workers binding and REST API for Cloudflare email?

The Workers binding uses email in the from object and replyTo, while the REST API uses address and reply_to in snake_case. The binding returns a messageId, whereas the REST API returns delivered, permanent_bounces, and queued arrays.

How do I receive and parse incoming emails with Email Routing?

Export an email() handler from your Worker and create a routing rule pointing addresses to it. Buffer message.raw once with new Response(message.raw).arrayBuffer(), then parse it with postal-mime to access subject, text, and attachments.

Why does my Cloudflare email send fail with E_SENDER_NOT_VERIFIED?

This error means the from domain has not been onboarded to Email Sending. Run wrangler email sending enable yourdomain.com or onboard the domain in the Dashboard, which auto-configures SPF and DKIM records.

Can I use Cloudflare Email Service for marketing campaigns?

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

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

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