activities
latest
false
Productivity Activities
Last updated Oct 23, 2024

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.

    Note: Using an IP address in the Server field instead of a DNS name only works when there are no SSL connections or if there is an SSL certificate issued for the IP address.
Logon
  • ClientName - The Name property of the IMAP client implementation.
  • ClientVersion - The Version property of the IMAP client implementation.
  • Email - The email account used to get the message.
  • Password - The password of the email account used to get the message. If UseOAuth is selected, the value of this parameter must be an OAuth2 access token.
  • SecurePassword - The password of the email account used, as a secure string. If UseOAuth is selected, the value of this parameter must be an OAuth2 access token.
  • UseOAuth - Indicates whether to use an OAuth2 access token instead of a password. By default, this option is not selected.
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.
  • Ignore CRL - Specifies whether to ignore the Certificate Revocation List validation when connecting. This field only accepts Boolean values and variables. If left empty, the default False value is used.
  • 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.
  • Properties
  • Filtering Examples

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.