Integration · Node.js
Send email from Node.js with Nodemailer
Nodemailer is the standard way to send SMTP mail from Node.js. Use a pooled transport for throughput.
Steps
- 1Install nodemailer.
- 2Create a pooled transport with your credential.
- 3Send from an address at your verified domain.
Connection settings
- Host
- smtp.mailerace.com
- Port
- 587 (STARTTLS) or 465 (TLS)
- Auth
- your SMTP credential
import nodemailer from 'nodemailer';
const transport = nodemailer.createTransport({
host: 'smtp.mailerace.com',
port: 587,
secure: false, // STARTTLS is required on 587
requireTLS: true,
pool: true,
auth: { user: process.env.MAILERACE_SMTP_USER, pass: process.env.MAILERACE_SMTP_PASSWORD },
});
await transport.sendMail({
from: 'Acme <[email protected]>',
to: '[email protected]',
subject: 'Your receipt',
text: 'Thanks for your order!',
});Send from Node.js with confidence
Authenticated, signed and delivered from warm IPs, with a log of every message.