EML icon

EML

Node to work with EML files

Actions2

EML → Compose EML

AI-generated

Overview

This node operation composes an EML (email) file from provided input parameters such as sender, recipient(s), subject, text content, and optional parameters like CC, BCC, HTML content, attachments, inline attachments, and custom headers. It is useful for creating email messages programmatically within an n8n workflow, for example, to generate emails for sending or archiving.

Use Case Examples

  1. Compose an email with a sender, multiple recipients, subject, and plain text content.
  2. Add CC and BCC recipients to the email.
  3. Include HTML content and attach files from binary data properties.
  4. Add custom email headers for advanced email handling.

Properties

Name Meaning
From The email address of the sender.
To The email address of the recipient, or a comma-separated list of addresses. Each address can be in the format "email@example.com" or "Name email@example.com".
CC The email address of the CC recipient, or a comma-separated list of addresses. Each address can be in the format "email@example.com" or "Name email@example.com".
Subject The subject of the email.
Text The text content of the email.
Optional Parameters Additional optional parameters for the email including BCC recipients, HTML content, attachments, and inline attachments.
Headers Custom email headers as name-value pairs. Multiple headers can be added.

Output

JSON

  • from - The sender's email address.
  • to - The recipient(s) email address(es).
  • cc - The CC recipient(s) email address(es).
  • bcc - The BCC recipient(s) email address(es).
  • subject - The subject of the email.
  • text - The plain text content of the email.
  • html - The HTML content of the email.
  • attachments - List of attachments included in the email.
  • inlineAttachments - List of inline attachments included in the email.
  • headers - Custom headers added to the email.

Dependencies

  • No explicit external dependencies are indicated in the source code, but the node likely requires an environment capable of handling email composition and possibly binary data for attachments.

Troubleshooting

  • Ensure that email addresses are correctly formatted to avoid errors in composing the email.
  • If attachments or inline attachments are specified, verify that the binary property names exist and contain valid data.
  • Custom headers should be correctly formatted as name-value pairs; invalid headers may cause issues.
  • Errors during execution will throw NodeOperationError with details; check the error message for specifics.

Discussion