Send transactional mail from a Cloudflare Worker binding
Configure the native send_email binding and submit an approved message without copying the REST API's different address/response model.
Reviewed
For a Worker deployment, use Cloudflare’s native email binding after domain onboarding. Add the binding to the existing Wrangler configuration; do not replace the rest of the application configuration:
{ "send_email": [{ "name": "EMAIL" }] }
Call the binding from an authorized application action
This is a handler excerpt, not a public unauthenticated send endpoint. Supply the approved sender and controlled recipient, and authorize the triggering application operation before calling it:
const result = await env.EMAIL.send({
from: { email: approvedSender, name: "Application" },
to: controlledRecipient,
subject: "Cloudflare controlled test",
text: "A message from the onboarded application domain.",
});
console.log({ messageId: result.messageId });
The Workers API reference defines this builder and result. REST API field names and response shape differ; do not mix its address/snake-case model into a binding example.
Verify and handle failures
Persist the intended send and returned identity, then check available sending activity and the controlled inbox. Handle the documented sender-verification, validation, and rate-limit errors at their actual boundary.
An exception/timeout may require investigation before retrying. A successful binding call is not a blanket inbox-placement guarantee. Respect the transactional-only channel and its account/domain limits.
For a platform-independent application path, use MailKite’s sending SDK with its own verified domain; a Cloudflare binding is not automatically a MailKite client.