Subscribe

UiPath Activities

The UiPath Activities Guide

Get IMAP Mail Messages

UiPath.Mail.IMAP.Activities.GetIMAPMailMessages

Retrieves an IMAP email message from a specified server.

Properties

Common

  • DisplayName - The display name of the activity.
  • TimeoutMS - Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown. The default value is 30000 milliseconds (30 seconds).

Host

  • MailFolder - The mail folder from which the messages are to be retrieved.
  • Server - The email server host that is to be used.
  • Port - The port used to get the email message.

Logon

  • Email - The email account used to get the message.
  • Password - The password of the email account used to get the message.
  • SecurePassword - The password of the email account used, as a secure string.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

Options

  • DeleteMessages - Specifies if the read messages should be marked for delete.
  • FilterExpression - Returns only those mail messages matching the filter expression.
  • FilterExpressionCharacterSet - The MIME name of the character set to be used for the filter expression.

📘

Note:

The list of valid MIME names that can be used is available at Character Sets.

  • MarkAsRead - Specifies whether to mark retrieved messages as read. By default, this check box is cleared.
  • OnlyUnreadMessages - Specifies whether to retrieve only unread messages. By default, this check box is selected.
  • OrderByDate - Order mail messages by date. Choose one of two options: Newest First, OldestFirst. The default value is Newest First.
  • SecureConnection - Specifies the SSL and/or TLS encryption to be used for the connection.
  • Top - The number of messages to be retrieved, starting from either the newest or the oldest, depending on the OrderByDate parameter.

Output

  • Messages - The retrieved messages as a collection of MailMessage objects.

Filtering Examples

The following table shows examples of filters that can be useful when you query IMAP mail messages:

Query

Filter Expression

All mail messages that contain "Welcome" in the subject

"SUBJECT Welcome"

All mail messages that contain "Welcome" in the subject and are from "john.smith@example.com"

"SUBJECT Welcome FROM john.smith@example.com"

All mail messages that contain "Welcome" in the subject and are not from "john.smith@example.com"

"SUBJECT Welcome NOT FROM john.smith@example.com"

All mail messages that contain "Please review" in the body

"BODY ""Please review"""

All flagged mail messages (i.e. \Flagged flag set)

"FLAGGED"

All mail messages since 02/23/2021

"SINCE 23-Feb-2021"

All non-delivery report mail messages received on 02/23/2021 or 01/23/2021

"OR (ON 23-Feb-2021 FROM postmaster@outlook.com) (ON 23-Jan-2021 FROM postmaster@outlook.com)"

All mail messages unanswered today and from an email address that contains "examples.com"

"UNANSWERED ON " + DateTime.Today.ToString("dd-MMM-yyyy") + " FROM examples.com"

📘

Note:

Learn more about how to specify a filter expression here.

Updated 17 days ago


Get IMAP Mail Messages


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.