Email

This step helps you access email by opening a folder on the email server and presenting it in the tree. The opened folder is represented in the application tree and as a table in the Recorder View. For each message, the table lists the following properties as columns:

  • From: The sender in the format John Doe <j.doe@organization.com>.

  • Subject: The subject line of the message.

  • Received: The date when the message was received, in the format 2023-05-17T15:27:33+01:00 (ISO-8601).

  • Size: The size of the message in bytes.

  • Has attachment: Whether the message has attachments.

  • Is read: Whether the message is marked as read.

  • Attachment count: The number of the attachments.

The tree and the table with messages do not reflect changes made to the email folder that can occur after the step is executed, such as moving or deleting a message.

When stepping over an Email step with an "Open email folder" action, it is not possible to stop the loading of the email folder.

Also, use the Email step to open email as HTML and extract email attachments without opening the email.

Properties

Action: Open email folder

This action connects to an email server and opens the selected email folder.

Application name

Specify the name for the application.

Assign different application names to applications in a Robot to avoid errors.

Protocol

Select the email protocol used to connect to the email server: Select from "imap", "pop3," and their secure variants "imaps," "imap+tls," and "pop3s." The option "imap+tls" is for email servers requiring opportunistic TLS.

Email server

Specify the name or address of the email server.

Email server port (optional)

Specify a port number of the email server. If not provided, the standard port of the selected protocol is used.

Account name and Password

Enter credentials to log in to the email server.

Path in mailbox (optional)

The name of the folder to open on the email server. It may be in the form of a path for a nested folder, in which case the elements in the path must be separated with slashes. To open the folder where the incoming email is stored, do not provide any path or name.

Examples: Junk E-Mail, Subscriptions/Mailing lists.

Leave this field blank when using the POP3 or POP3S protocols, as POP3 does not support folders.

The opened folder is represented in the application tree. A folder can contain zero or more messages. Each message has a "der_index" property that indicates its place in the folder. Indexes start at 1 and are consecutive.

To retrieve the attachments, select the Get attachment component action.

Application actions

The following application action is available.

Action

Description

Close email folder

Closes the application.

Component actions

The following component actions are available.

Action

Description

Copy message

For IMAP and IMAPS protocols. Copies the selected message to the specified target folder. The availability of the action depends on whether the email server supports the copy operation.

Delete message

Removes an email message.

Get message content

Returns a string value containing the message and headers in RFC 822 format.

Open message as HTML

Opens an email as an HTML web page, using the Chromium built-in browser. Operates on a row in an opened email table.

Move message

For IMAP and IMAPS protocols. Moves the selected message to the specified target folder. The availability of the action depends on whether the email server supports the move operation.

Mark message as read

For IMAP and IMAPS protocols. Flags a message as read or unread.

Select the check box Is read to mark the message as read, or clear the check box to mark the message as unread.

Get attachment

Retrieves the attachment binary data and stores it in a variable. This action is useful when the attachment is large.

To retrieve the required data, configure the following properties.

  • Index: A zero-based index of the attachment to extract.

  • Attachment data: The binary variable that stores the resulting attachment data.

POP3 or POP3S protocol restrictions

  • No folder support. The folder name on the "Open email folder" action must be empty or "INBOX."
  • Some POP3 servers do not reflect changes made through the POP3 connection on other interfaces. For example, when a Robot deletes a message from a Gmail account using the POP3 protocol, the web browser interface may continue to show that message. For the robot, the message is deleted.
  • The Delete Message step marks a message for deletion, but it stays on the server until the application is closed.
  • Most POP3 servers delete messages after they have been downloaded.
  • The "read" or "unread" flag cannot be set.

Action: Open email as HTML

This action opens an email message as an HTML web page using the Chromium built-in browser. Only email files (.eml) in MIME format are supported. This action uses the text value.

Before the Email step, insert the Read File and Assign steps. Perform the following actions.

  1. Configure the Read File step to read and store binary data from the .eml file.

  2. Configure the Assign step to convert binary to text.

    The following is an example of the expression: =text(mail_bin, "utf-8"), where mail_bin is a binary variable specified in the Read File step.

Textual variants of the email, such as plain text and HTML, are rendered in the resulting web page. At the top of the web page, a table containing the headers (for example, Subject) is displayed. Below it, a table lists available attachments.

Application name

Specify the name for the application.

Email message

Specify the email to be opened as a text value preceded by an equal sign.

Include all headers

Select this option if you want to view all headers in the resulting web page.

By default, the step includes only basic header information, such as From, To, Subject, Date, and Message-ID.

Decode header values

Select to decode header values into Unicode. This is common to email clients and helps to display non-English text.

By default, this option is selected.

Inline CID image tags

Specifies if content-specified images should be inlined as tags. Only applies to the text variant of an email.

By default, the tags are inlined.

Inline attachments

Specifies if attachments should be entirely inlined. If you select this option, the attachment table will contain data URLs which you can use to download the data using the browser.

To view the attachment, right-click its URL, select the Extract Target component action, specify the binary variable, and click Step Over.

We do not recommend using this option to view large attachments.

Action: Extract attachment from email

This action extracts attachments from an email and stores them in the binary variable without opening the email. Use this action to extract large attachments.

Configure the Read File and Assign steps as described in the previous action.

Email message

Specify the email to be opened as a text value preceded by an equal sign.

Only email files (.eml) in MIME format are supported.

Index

The zero-based index of the attachment to extract.

Results: Attachment data

Specify the binary variable that stores the resulting attachment data.