Guides
Adapters
Configure an explicit SMTP socket adapter for a supported runtime.
The one rule
Use an adapter only when SMTP auto-detection is not suitable for your runtime.
| Runtime | Import | Class |
|---|---|---|
| Node.js | sently/adapters/node | NodeAdapter |
| Bun | sently/adapters/bun | BunAdapter |
| Deno | sently/adapters/deno | DenoAdapter |
| Cloudflare Workers | sently/adapters/cf | CloudflareAdapter |
import { createSMTPMailer } from "sently/smtp";
import { NodeAdapter } from "sently/adapters/node";
const mailer = await createSMTPMailer({ host: "smtp.example.com", adapter: new NodeAdapter() });Use an HTTP transport, or provide the runtime's supported SMTP adapter.
CloudflareAdapter passes expectedServerHostname from the relay hostname. IP literals omit that name. Deno passes the same hostname to startTls.
SMTP calls destroy() when the handshake timer fires. Node and Bun abort the socket. Deno and Workers destroy() closes the connection; the runtime has to unblock startTls for the send to settle.