Email Reader
Overview
You can use this Snap to read IMAP or POP3 server email messages. In addition to reading emails, you can also process inline images, images sent as attachments, archive read emails using this Snap. The Snap allows you to choose the target folder where such archived emails are moved, and you can use this feature to delete emails as well by configuring the corresponding 'trash' folder in your email.

Read-type Snap
Works in Ultra Tasks
Prerequisites
This Snap requires a valid IMAP or POP 3 account to handle access to this endpoint.
Clicking the "Preview" button does not read any email message if the account is IMAP and the Unread only property is checked. When unread messages are read, they are all marked as "read" in the mail server. Therefore, they should not be read during the preview. Otherwise, the execution of the Snap will not be able to read any message.
Limitations
-
+OK Gpop ready for requests from 23.23.38.68 n18mb191678450qav" or
-
Cannot connect to the endpoint reason: [SYS/PERM] Your account is not enabled for POP access. Please visit your Gmail settings page and enable your account for POP access." or other variations.
You may find an email from Gmail in the inbox titled "Suspicious sign in prevented", which is caused by the execution of Email Reader Snap. You may be able to see more messages from Gmail in your Gmail account web page: Account > Security > Recent Activity > View activity. As of writing this note, there seems to be no settings available in the Gmail account to disable this security feature. Please contact Gmail Support if your Gmail account must work in Email Reader Snap.
Snap views
| View | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input |
This Snap has at the most one document input view. By default, the input view is not enabled; however, you can specify at the most one input. |
|
| Output | This Snap has exactly one output view and produces documents in the view. Each
Document contains a Map data which represents one email message. The keys in the
document are "from", "to", "cc", "subject", "dateSent", "emailType", "textBody",
"htmlBody" and "attachments". The value of "from", "to" and "cc" keys is a list of
strings. The value of "subject" and "dateSent" keys is a string.The value of
"emailType" key is "text/plain" or "text/html" or "multipart/*". The value of
"attachments" key is a list of Map data. Each Map data corresponds to an attached
file. The keys of the Map data are "contentType", "filename" and "attachment". The
value of the "attachment" key is a binary data read from the attached file. If the
email message received has a nested multipart of content, all plain text bodies are
appended to the value of the "textBody" key, and all HTML contents to the value of
the "htmlBody" key. The following is an example of an Output Document:
|
|
| Error |
Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
|
Snap settings
- Expression icon (
): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field / Field set | Type | Description |
|---|---|---|
| Label | String | Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline. Default value: Email Reader Example: Email Reader |
| Mail folder | String/Expression/ Suggestion | Required. Specify the name of email folder where the Snap reads messages from. Important: Ensure that you specify the
folder name as it appears on the email client, because folder names might be
case-sensitive for some email providers, such as Yahoo. Otherwise, the Snap
displays Error retrieving folder for given source or destination
error.Default value: Inbox Example: Inbox |
| Unread only | Checkbox |
Select this checkbox to inform Snap to read only the unread email messages. If you do not select this checkbox, the Snap reads all messages. Warning: If this property is selected, the Snap does not execute during
preview as the execution changes the state of the unread messages.
Default status: Deselected |
| Number of messages | Integer | Specify the maximum number of messages that the Snap has to read. Any non-integer or negative value leads to "All" messages being moved. Default value: All Example: 100 |
| Older message first | Checkbox |
Select this checkbox to view the older messages first in the output view. If you do not select this checkbox, the latest messages display first in the output view. Default status: Deselected |
| Attachment folder | String/Expression | Specify the URL of the directory where attached files are stored. If this property is blank, all attached files are ignored. Warning:
The following are the most commonly-used target directory values:
Examples:
Default value: Shared Example: smb://<username>@<hostname>:<port>/<directory> |
| File action | Dropdown list | Select an action to be taken if a file with the same name as in the email
attachments exists in the specified directory. The available options include:
If ERROR is selected, the Snap displays an error message and the pipeline execution is terminated when it encounters an already existing file. Default value: OVERWRITE Example: RENAME |
| Archive messages after reading | Checkbox | Select this checkbox to move or archive the read messages. If you do not select
this checkbox, the read messages are not moved or archived. Default status: Deselected |
| Target folder | String/Expression/ Suggestion | Archive messages after reading Specify the target location for the archived emails. You need to configure this property only if you select the Archive messages after reading field. This is a suggestible field and the suggestions are based on the folders available in the email account. Important: Ensure that you specify the folder name as it appears on the
email client, because folder names might be case-sensitive for some email
providers, such as Yahoo. Otherwise, the Snap displays Error retrieving
folder for given source or destination error. Default value: None. Example: Archived |
| Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Execute only Default value: Validate & Execute |