Skip to content
You're viewing documentation for v0.5.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

SMTP

Configure generic SMTP for PurelyMail or a custom server.

The SMTP adapter is built in. It uses Node/Bun TCP and TLS sockets directly, so it does not need Nodemailer.

SMTP
SMTP@opencoredev/email-sdk/smtp
Provider docs

When auth is configured with secure: false, the adapter sends STARTTLS before authenticating. Set allowInsecureAuth: true only for a trusted local server that does not support TLS.

Before live sends

Confirm the SMTP host, port, TLS mode, username, and password with your provider. SMTP is a good fallback for simple transactional messages, but it does not support provider-only fields such as tags, metadata, or attachments.

Configure

Options

Option Type Required Notes
host string Yes SMTP host.
port number No Common values are 587, 465, and 25.
secure boolean No Use TLS from the start of the connection.
auth { user: string; pass: string } No SMTP credentials.
defaults { replyTo?: string } No Default reply-to header.
tls Record<string, unknown> No TLS options.
requireTLS boolean No Require STARTTLS.
allowInsecureAuth boolean No Opt in to SMTP AUTH without TLS.
name string No Defaults to smtp.
heloName string No EHLO name sent to the server.
timeoutMs number No Socket timeout.

Multiple SMTP routes

Rename adapters when you have multiple SMTP routes.

CLI

Last updated on