newsletter-builder
  • Type to search the documentation.

Sending & Deliverability Warnings

Sending and deliverability

Why sendDevEmail is development-only, and what production sending requires.

The development-only SMTP helper

scripts/send-test.ts
import { compileNewsletter } from 'newsletter-builder-react'
import { sendDevEmail } from 'newsletter-builder-react/node'

const email = compileNewsletter(doc, { variables: { firstName: 'Ada' } })

await sendDevEmail({
  to: 'dev@example.test',
  from: 'newsletter@example.test',
  email,
  smtp: { host: 'localhost', port: 1025 }, // Mailpit, MailHog or Mailtrap
})

The helper speaks plain SMTP using Node built-ins, has no dependencies and throws when NODE_ENV is production.

Production checklist

  • Use a transactional or marketing provider that manages IP reputation for you.
  • Publish SPF, DKIM and DMARC DNS TXT records for your sending domain.
  • Make sure the sending IP has matching reverse DNS (PTR).
  • Warm up new domains and IPs gradually.
  • Include a working unsubscribe link and a physical postal address in the footer.
  • Keep the HTML under 102 KB so Gmail does not clip it.