v1.3.3 • MIT licensed

Worker runtime email

Email for the Edge. Built for Cloudflare Workers.

worker-mailer keeps SMTP inside the Worker runtime, with a smaller transport layer, Bun-friendly workflows, and documentation that stays close to what the package actually ships.

Transport

SMTP

Direct delivery from Cloudflare Workers.

Optional

Queues

Move send work off the request path.

Typing

TypeScript

Hooks, DSN, attachments, and envelopes.

Current package surface

Direct Worker delivery

Cloudflare TCP sockets, SMTP auth modes, HTML/text bodies, and attachments.

Operational controls

Lifecycle hooks, DSN, custom SMTP errors, timeouts, and queue helpers.

Careful EmDash positioning

The project tracks the EmDash discussion, but this site does not pretend the integration contract is final.

Current surface area

A smaller mail stack, tuned for edge workloads.

worker-mailer focuses on the pieces that matter most in Workers: a lean SMTP client, solid types, and predictable delivery behavior.

SMTP

Cloudflare-native SMTP

Connect directly from a Worker using Cloudflare TCP sockets instead of pushing mail through a separate Node server.

A tighter delivery path with fewer moving parts at the edge.

TYPES

Type-safe envelopes

Typed transport and message options cover auth modes, DSN, attachments, headers, inline images, and queue payloads.

Safer refactors and faster editor feedback in Bun-first projects.

CID

HTML + inline assets

Send plain text, HTML, classic attachments, and inline CID images without bolting on a second mailer abstraction.

Useful for onboarding flows, invoices, and system notifications.

HOOKS

Hooks and observability

Lifecycle hooks and custom SMTP errors make it easier to trace connect, send, fail, and close events.

Helpful for retries, logging, and production diagnostics.

QUEUE

Queue-ready delivery

Optional Cloudflare Queues helpers let you move email work off the request path when throughput or latency matters.

Good fit for form spikes, batch sends, and webhook-heavy workloads.

DISCUSS

Watching EmDash carefully

The project is following the EmDash email-provider discussion, but this site only documents worker-mailer features that exist today.

No guessed plugin API, no speculative setup steps.

Example flows

Practical patterns without dumping code on the landing page.

The examples page now works like a catalog of real use cases. The full snippets stay in the documentation, where they belong.

smtp-basic.ts

Direct SMTP delivery

Connect once and send from a Worker when the request itself owns the delivery flow.

send-once.ts

One-off send

Use the static helper when you do not need to retain a transport instance between sends.

queue.ts

Queue consumer

Push email work into Cloudflare Queues to keep the request path thin.

inline-image.ts

HTML + CID image

Embed an inline image in the message body using a content ID attachment.

EmDash

Following the discussion without pretending the API is settled.

worker-mailer is relevant to the EmDash conversation because it already solves SMTP on Cloudflare Workers. That is different from claiming a final plugin contract or showing setup steps that have not been decided yet.

Concrete today

SMTP transport, queues, hooks, attachments, and TypeScript support.

Still open

Provider lifecycle, config conventions, and transport boundaries in EmDash.

How this site handles it

We link to the discussion and summarize the themes without fabricating examples.