IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node operation creates an email draft in a specified mailbox using the IMAP protocol. It supports two input formats for the email content: structured fields (subject, from, to, text) or a raw RFC822 formatted email string. This node is useful for automating email draft creation in workflows, such as preparing emails for review before sending or saving email templates.

Use Case Examples

  1. Creating a draft email with specified subject, sender, recipient, and body text in the INBOX mailbox.
  2. Using a raw RFC822 formatted email string to create a complex draft with attachments and rich formatting.

Properties

Name Meaning
Credential Type Selects the type of IMAP credentials to use for authentication (either credentials from this node or from an existing N8N IMAP Trigger node).
Mailbox The mailbox where the draft email will be created. Can be selected from a list or specified by full path.
Input Format Determines the format of the email content input, either as individual fields or as a raw RFC822 formatted email string.
Subject The subject line of the email (shown only if input format is 'Fields').
From The sender's email address (shown only if input format is 'Fields').
To The recipient's email address (shown only if input format is 'Fields').
Text The body text of the email (shown only if input format is 'Fields').
RFC822 Formatted Email The raw RFC822 formatted email string used to create the draft (shown only if input format is 'RFC822').

Output

JSON

  • draftId - Identifier of the created draft email
  • mailbox - The mailbox where the draft was created
  • subject - Subject of the draft email
  • from - Sender email address of the draft
  • to - Recipient email address of the draft
  • text - Body text of the draft email
  • rfc822 - Raw RFC822 formatted email content if input format was RFC822

Dependencies

  • IMAP server credentials (either node-specific or from an existing IMAP trigger node)

Troubleshooting

  • Connection failures due to incorrect IMAP credentials or network issues. Verify credentials and network connectivity.
  • Errors related to unsupported or malformed email content formats. Ensure the email content matches the selected input format.
  • Operation failures with error messages from the IMAP server. Check server logs and node error details for diagnosis.

Links

Discussion