cloudflare-email-service

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

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/Aki2022/skills --skill cloudflare-email-service-aki2022
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-email-service
Source: https://github.com/Aki2022/skills/tree/main/cloudflare-email-service
Command: npx skills add https://github.com/Aki2022/skills --skill cloudflare-email-service-aki2022

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 requires correct domain onboarding, DNS authentication records, binding configuration, and deliverability practices. This Skill guides you through sending and receiving email with Cloudflare Email Service while avoiding common configuration mistakes. ## Core Features & Use Cases - Send emails from Workers: Use the send_email binding with env.EMAIL.send() for attachments, custom headers, and batch recipients without managing API keys. - Send from any platform: Use the REST API from Node.js, Python, Go, or coding agents via wrangler CLI and MCP tools. - Receive and route inbound email: Handle incoming messages with the Workers email() handler, forward, reply, parse MIME with postal-mime, or integrate with the Agents SDK. - Use Case: You want your Cloudflare Worker to send a welcome email after signup. This Skill walks you through onboarding your domain, adding the binding to wrangler.jsonc, and calling env.EMAIL.send() with correct field names. ## Quick Start Ask the agent to add email sending to your Cloudflare Worker using the send_email binding and onboard your domain with wrangler.

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, and html or text fields. The from domain must first be onboarded using wrangler email sending enable yourdomain.com.

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

POST to https://api.cloudflare.com/client/v4/accounts/{account_id}/email/sending/send with a Bearer API token. Note the REST API uses address instead of email in the from object and reply_to instead of replyTo.

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. Parse the raw MIME stream with postal-mime, but buffer message.raw first since the stream is single-use.

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

The E_SENDER_NOT_VERIFIED error means your from domain has not been onboarded to Email Sending. Run wrangler email sending enable yourdomain.com or onboard the domain in the Cloudflare Dashboard before sending.

Can I use Cloudflare Email Service for marketing campaigns?

No, Cloudflare Email Service is restricted to transactional email such as signups, password resets, and order confirmations. Marketing or bulk campaigns are not permitted and require a dedicated marketing email platform.

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

The Workers binding uses email in the from object, replyTo, string E_* error codes, and raw string or ArrayBuffer attachment content. The REST API uses address, reply_to, numeric error codes, and base64-encoded attachments.