Read email

Email inbox
Read email
Success
Email(Email)
Error
Text body
HTML body
Headers(HTTP headers)

Description

Fetches a message's body, which Find emails deliberately skips so that searching a large mailbox stays cheap. Outputs the plain-text and HTML parts (either is empty when the message has no such part) and the full header block, which Get HTTP header and Get HTTP header values can read. Reading does NOT mark the message as read — use Set email flag for that. Branches on success/error.

When to use

Use Read email whenever you need the words in a message. Find emails returns everything about a message — subject, sender, recipients, flags, size, attachment list — but not the body, so that searching a mailbox costs the same whether the messages are 2 KB or 2 MB. This node is the second round trip that gets the text.

Reading does not mark the message as read. The fetch peeks, deliberately: a node named “Read email” that quietly mutated server state would be a trap, and it would break the common polling shape where the unread flag is what tracks outstanding work. Set the flag explicitly with Set email flag once you have finished processing.

Both body outputs are strings, already decoded from base64 or quoted-printable and converted from the message’s charset to UTF-8. A message with only one of the two parts leaves the other empty — check with String is empty rather than assuming. Individual body parts are capped at 5 MiB; a larger one takes the Error branch rather than arriving truncated.

The Headers output covers everything the email object’s own fields do not: Message-ID threading headers, List-Unsubscribe, DKIM results, custom X- headers your systems set.

Pins

Input pins

Pin Type Default Notes
Email Email — An email object from Find emails or Get email. The server connection comes from the email itself, so this node needs no credentials.

Output pins

Pin Type Notes
Text body string The message's `text/plain` part, decoded from its transfer encoding and converted to UTF-8. Empty when the message is HTML-only.
HTML body string The message's `text/html` part, decoded and converted to UTF-8. Empty when the message is plain-text only.
Headers HTTP headers The full RFC 5322 header block. Despite the class being named for HTTP, mail and HTTP headers are the same multi-valued, case-insensitive shape — read individual headers with Get HTTP header and Get HTTP header values. Encoded-word headers are decoded to UTF-8.

Execution pins

Pin Direction
In Input
Success Output
Error Output

Example

Extract an order number from an incoming email. After Find emails, For each, wire the element into Read email. On Success, feed Text body into String split on Order # and take element 1, then Substring to pull the digits out. Wire Headers into Get HTTP header with name X-Order-Source to read the custom header your webshop sets. End the iteration with Set email flag (SEEN, true) on the same element.

See also