Actions9
Overview
This node connects to an IMAP email server to manage emails and mailboxes. Specifically, the "Create Draft" operation allows users to create a draft email message in a specified folder on the IMAP server. This is useful for automating email workflows where draft messages need to be prepared and saved for later review or sending.
Practical examples include:
- Automatically saving templated draft emails for review before sending.
- Creating drafts based on form submissions or CRM triggers.
- Preparing multi-recipient emails with predefined content and saving them as drafts.
Properties
| Name | Meaning |
|---|---|
| Draft Folder | The folder where the draft email will be saved. Can be selected from a list of folders or specified by name (e.g., "Drafts"). |
| To | Comma-separated list of recipient email addresses. Required field. |
| Subject | Subject line of the draft email. |
| Message Format | Format of the message body. Options: Text (plain text), HTML (formatted HTML), Both (text and HTML versions). |
| Text Body | Plain text version of the email body. Shown if Message Format is "Text" or "Both". |
| HTML Body | HTML version of the email body. Shown if Message Format is "HTML" or "Both". |
| CC | Comma-separated list of CC recipients. |
| BCC | Comma-separated list of BCC recipients. |
| From Name | Optional display name for the sender. |
Output
The node outputs an array of items, each containing a json object representing the result of the operation. For the "Create Draft" operation, this typically includes metadata about the created draft message such as its unique identifier or status confirmation.
If multiple input items are processed, the output will contain one item per input, preserving order.
No binary data output is indicated by the source code.
Dependencies
- Requires connection credentials to an IMAP server: host, port, security settings, username, and password.
- Uses the
imapflowlibrary to interact with the IMAP server. - The node requires proper IMAP credentials configured in n8n to authenticate and perform operations.
Troubleshooting
- Connection issues: Errors connecting to the IMAP server may occur due to incorrect host, port, or authentication details. Verify credentials and network accessibility.
- Timeouts: The node sets timeouts for socket and connection; slow servers or network issues might cause timeout errors.
- Folder not found: Specifying a draft folder that does not exist on the server may cause errors. Ensure the folder name or selection matches an existing mailbox.
- Invalid email addresses: Improperly formatted recipient addresses in "To", "CC", or "BCC" fields can cause failures.
- Permission errors: The authenticated user must have permission to create drafts in the specified folder.
- Error handling: If "Continue On Fail" is enabled, errors for individual items will be returned as JSON error messages instead of stopping execution.
Links and References
- IMAP RFC 3501 – Protocol specification for IMAP.
- imapflow GitHub repository – The underlying IMAP client library used.
- n8n Documentation - IMAP Node – Official documentation for the IMAP node in n8n.