Native send_email Binding
Dispatches mail exclusively through Cloudflare's EMAIL binding without hardcoding domains, addresses, or credentials in source code.
Built on Cloudflare Workers native send_email bindings with source IP allowlisting, constant-time multi-token rotation, edge rate limiting, and strict UTF-8 payload validation.
AI Translation Notice
This page is a synchronized English edition. Refer to the Chinese documentation home as the authoritative source if any wording differs.
What Cloudflare Email Relay Delivers
POST /v1/send, legacy panel POST /v1/panel, and 7-criteria /healthz readiness checks backed by Cloudflare's native EMAIL (send_email) binding.CF-Connecting-IP CIDR allowlists and optional RATE_LIMITER limits before reading a 128 KiB UTF-8 JSON body, matching comma-separated AUTH_TOKENS via full constant-time SHA-256 XOR.256 B) and text/html (96 KiB each), rejects unknown fields and duplicate recipients, and redacts bodies/secrets from logs.Explicit Non-Goals & Hard Boundaries
415).200 OK confirms EMAIL.send acceptance rather than final inbox placement; wrangler.jsonc binding allowlists act independently, and local wrangler dev stops at 502 without sending real mail.Static Topology Canvas Calibration
The interactive canvas below is a preserved static concept diagram. The actual codebase uses Cloudflare Workers native send_email (EMAIL binding), POST /v1/send, POST /v1/panel, and GET/HEAD /healthz—it does not include the template renderer or external mail drivers shown in legacy canvas labels. See Request Flow & Topology for the code-verified execution pipeline.
# 1. Install dependencies at repository root and run typecheck + 86 mocked Vitest tests
pnpm install --frozen-lockfile
pnpm run check && pnpm test
# 2. Copy local secret template and start Wrangler local simulation
# Note: send_email cannot deliver externally in wrangler dev; reaching 502 confirms all guards passed
cp .dev.vars.example .dev.vars
pnpm run devSend a standard send request once deployed (placeholder domains and token for illustration only):
curl -X POST "https://relay.example.com/v1/send" \
-H "Authorization: Bearer <32_to_512_char_token>" \
-H "Content-Type: application/json" \
-d '{"from":"alert@example.com","to":"ops@example.org","subject":"Build failed","text":"Check the CI logs"}'Quick Navigation by Role & Goal
POST /v1/send and POST /v1/panel payload schemas, headers, limits, and error codes;send_email setup, secret injection, and /healthz checks;src/ and test/;AUTH_TOKEN / WEBHOOK_TOKEN.