Skip to main content

Message Playground

Use this interactive playground to experiment with Nodemailer message configuration and see a live preview of how your email will appear to recipients.

Switch between the Editor tab to modify the JSON configuration and the Preview tab to see how your email will render. The playground supports all common message fields including from, to, cc, bcc, subject, text, and html.

Message Configuration (JSON)

Supported fields

The playground supports the following message configuration fields:

FieldDescription
fromSender address (string or object with name and address)
toRecipient address(es) - string, array, or object
ccCarbon copy recipient(s)
bccBlind carbon copy recipient(s)
replyToReply-to address(es)
subjectEmail subject line
textPlain text message body
htmlHTML message body (takes precedence over text)
attachmentsArray of attachment objects (see limitations below)
tip

If you only provide a text field without html, the playground will automatically convert the plain text to a simple HTML representation for preview purposes.

Attachment limitations

The playground only supports attachments with base64-encoded content. Other content sources (file paths, URLs, streams, buffers) are not available in the browser environment. Each attachment must include:

  • content - Base64-encoded string
  • encoding - Must be set to "base64"
  • filename - Name of the file
  • contentType - MIME type (optional, detected from filename if omitted)
  • cid - Content-ID for embedding images in HTML (optional)

Attachments with a cid value can be referenced in HTML using <img src="cid:your-cid-value">.

Address formats

You can specify email addresses in several formats:

// Plain email address
"to": "recipient@example.com"

// With display name
"to": "\"Recipient Name\" <recipient@example.com>"

// Object format
"to": { "name": "Recipient Name", "address": "recipient@example.com" }

// Multiple recipients (array)
"to": ["user1@example.com", "user2@example.com"]

// Multiple recipients (comma-separated)
"to": "user1@example.com, user2@example.com"

For more details on message configuration, see the message configuration reference.