This page is the JavaScript-focused companion to the broader sending emails guide. Use it when you want practical Node.js examples and implementation patterns for app code and test suites.

Core API call

The primary call shape is:

  • : the MailSlurp inbox that sends the message.
  • : recipients, content, headers, and delivery options.

Minimum payload

is the key field most workflows start with:

Common SendEmailOptions fields

Use named senders where needed:

  • Plain:
  • Named:

HTML and template variables

Set when sending markup-based email:

For reusable transactional messages, use template variables:

Attachments in Node.js

Workflow:

  1. Read file bytes.
  2. Convert to base64.
  3. Upload attachment.
  4. Send using returned attachment IDs.

See base64 uploads for language-specific patterns.

Production-safe sending checklist

  • Validate recipient quality before high-volume sends.
  • Use queue-backed send flows for retry resilience.
  • Add delivery/bounce webhooks for visibility.
  • Keep sender identity (SPF/DKIM/DMARC) aligned with your domain policy.

Related:

Next step

If this is part of test automation, move to receive emails in code and add deterministic receive-side assertions.