Transports

SMTP

Connect to an SMTP relay with an explicit transport.

Connect to an SMTP relay with an explicit transport.

The one rule

Create this transport under the matching sently channel sender.

Configuration

OptionTypeDefault or requirement
hoststringrequired
portnumber587 or 465 based on secure
securebooleanfalse
authSMTPAuthoptional
requireTLSbooleantrue when auth is set
adapterSocketAdapteroptional
poolbooleanfalse
dkimDKIMConfigoptional
import { createMailer } from "sently/mailer";
import { SMTPTransport } from "sently/transports/smtp";

const sender = createMailer({ transport: new SMTPTransport({ host: "smtp.example.com", auth: { user: "user@example.com", pass: "..." } }) });
await sender.send({ from: "hello@example.com", to: "person@example.com", subject: "Hello", text: "Hi" });

On this page