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.
SMTP v0.1.4 • Resend v0.1.0 • MIT licensed
Worker runtime email
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
worker-mailer focuses on the pieces that matter most in Workers: lean SMTP and Resend transports, solid types, and predictable delivery behavior.
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.
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.
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.
Lifecycle hooks and custom SMTP errors make it easier to trace connect, send, fail, and close events.
Helpful for retries, logging, and production diagnostics.
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.
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
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
Connect once and send from a Worker when the request itself owns the delivery flow.
send-once.ts
Use the static helper when you do not need to retain a transport instance between sends.
queue.ts
Push email work into Cloudflare Queues to keep the request path thin.
inline-image.ts
Embed an inline image in the message body using a content ID attachment.
EmDash
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.