eusend
SMTP

Nodemailer SMTP

Send email from Node.js through eusend with Nodemailer over SMTP — implicit TLS on port 465, DKIM-signed and tracked.

Nodemailer is the standard way to send email from Node.js. Point its SMTP transport at eusend and every message is DKIM-signed, tracked, and subject to the same limits as the HTTP API.

Install

npm install nodemailer

Transport

mailer.ts
import nodemailer from 'nodemailer'

export const transport = nodemailer.createTransport({
  host: 'smtp.eusend.dev',
  port: 465,
  secure: true, // implicit TLS — encrypted from the first byte
  auth: {
    user: 'eusend', // always the literal string "eusend"
    pass: process.env.EUSEND_API_KEY, // eu_live_…
  },
})
⚠

secure: true selects implicit TLS on port 465. Do not set secure: false (that expects STARTTLS on 587, which eusend does not support).

Send an email

await transport.sendMail({
  from: 'Acme <hello@yourdomain.com>', // must be a verified domain
  to: 'alice@example.com',
  subject: 'Your order has shipped',
  html: '<p>Order #1234 is on its way.</p>',
  text: 'Order #1234 is on its way.',
})

Attachments, cc, bcc, replyTo, and custom headers all work as usual — Nodemailer builds the MIME message and eusend relays it.

To tag a relayed send for log filtering and webhook routing, add an X-Eusend-Tag header:

await transport.sendMail({
  from: 'Acme <hello@yourdomain.com>',
  to: 'alice@example.com',
  subject: 'Reset your password',
  html: '<p>Here is your reset link.</p>',
  headers: { 'X-Eusend-Tag': 'category=password_reset, tier=pro' },
})

Verify the connection

await transport.verify() // resolves if the host, port, and auth are correct

Connection reference

OptionValue
hostsmtp.eusend.dev
port465
securetrue
auth.usereusend
auth.passyour eusend API key (eu_live_…)
froman address on a verified domain
ℹ

For a richer typed API — batch sends, scheduling, templates, idempotency — use the Node.js SDK over the HTTP API instead. SMTP is best when a library or framework already speaks it.

Troubleshooting

SymptomCause and fix
Error: Invalid login: 535 … (EAUTH)Read the response text. Invalid credentials means the username is not the literal eusend or the API key is wrong. A message naming a domain means the From address is on a domain you have not verified.
Error: Greeting never received (ETIMEDOUT)secure is false, so Nodemailer waits for a plaintext greeting on a TLS port. Set secure: true with port: 465.
Error: Connection timeout (ETIMEDOUT)Your host blocks outbound port 465, or the port is set to 587 or 25. eusend only accepts SMTP on 465. Ask your host to open it, or send through the HTTP API.
535 Too many failed attempts or 421 Connection rejectedRepeated failed logins block your IP address for up to an hour. Fix the credentials, then wait before retrying.
pass is undefinedEUSEND_API_KEY is not set in the environment the process runs in. Nodemailer then fails the login with a 535.
Send rejected with 452A rate limit or your daily sending ceiling was hit. Retry later, and reuse one transport with pool: true rather than opening a connection per message.

See the SMTP overview for the full status-code table.