SMTP v0.1.4 • Resend v0.1.0 • MIT licensed

Worker runtime email

Email for the Edge. SMTP and Resend on Cloudflare Workers.

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

Transport

SMTP

Direct delivery from Cloudflare Workers via TCP sockets.

API

Resend

Fetch-based delivery aligned with SMTP patterns.

Optional

Queues

Move send work off the request path.

Current package surface

SMTP delivery

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

Resend delivery

Fetch-based API with aligned envelope and queue helpers.

EmDash sandbox bundles

Sandbox-ready bundles ship alongside both libraries for EmDash wiring.

Current surface area

A smaller mail stack, tuned for edge workloads.

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

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.

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.

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 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-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.

EmDash-ready sandbox bundles

Both SMTP and Resend ship with sandbox-compatible bundles so you can wire them into EmDash without guessing the API.

Publish bundles live alongside each package in the repo.

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

EmDash-ready bundles without inventing APIs.

SMTP and Resend ship with sandbox-compatible bundles so EmDash teams can test providers without guessing at upstream contracts.

Concrete today

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

Still open

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

How this site handles it

We document real bundles and link to the discussion without fabricating examples.