activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Dec 18, 2024

Get Mail

UiPath.MicrosoftOffice365.Activities.Mail.GetMail

Description

Uses the Microsoft Graph Get message and List messages APIs to retrieve the matching messages from a specified mailbox (Mailbox).

After performing the search, the activity returns an array of the matching Office365Message objects (Results) that you can use as input variables in subsequent activities (e.g., Forward Mail and Move Mail).
Scopes

This activity requires the following scopes:

  • Mail.Read AND User.Read

OR

  • Mail.ReadWrite AND User.Read

OR

  • Mail.Read.Shared AND User.Read

OR

  • Mail.ReadWrite.Shared AND User.Read

OR

  • Mail.Read AND User.ReadWrite

OR

  • Mail.ReadWrite AND User.ReadWrite

OR

  • Mail.Read.Shared AND User.ReadWrite

OR

  • Mail.ReadWrite.Shared AND User.ReadWrite

Project compatibility

Windows - Legacy | Windows

Configuration

Properties
Common
  • DisplayName - The display name of the activity. This property supports String variables and string formatted values.
Input
  • Account - (Optional) The email address with which to interact. This may include any shared mailbox to which the current user has access rights. If left blank, the current user's account is assumed. This property supports String variables and string formatted values.
    Note: Account field is mandatory for ApplicationIdAndSecret and ApplicationIdAndCertificate authentication types.
  • Mail Folder - The mail folder from which the messages are retrieved. Enter your folder as it appears in your Outlook application (e.g., "Inbox", "Sent Items", "Deleted Items", etc.). Subfolders use the format "ParentFolder/SubFolder/AnotherSubfolder". This property supports String variables and string formatted values.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level. This field supports Boolean values.
Options
  • Email ID - The ID of the email to look for. When specified, the Account, Get As HTML, and Mark As Read parameters are taken into consideration while Only Unread Messages, Order By Date, Query, and Top parameters are ignored. If the email with the specified ID is found, the output array contains exactly one element. If not found, the activity throws an exception. This property supports String variables and string formatted values.
  • Get As HTML - If selected, the message body is returned in HTML format. This field supports Boolean values.
  • Mark As Read - If selected, the returned messages are marked as read. This field supports Boolean values.
  • Only Unread Messages - If selected, only unread messages are returned. This field supports Boolean values. The default value is True.
  • Order By Date - The returned messages are ordered by date. The available options are NewestFirst and OldestFirst.
  • Query - Query used for filtering the returned emails. If the query is not completed, all emails are returned. Enter your String using the $filter OData query parameter. Below are some example inputs:
    • "from/emailAddress/address eq 'someone@company.com'"
    • "subject eq 'Office365 Quickstart'"
    • "subject eq 'Office365 Quickstart' and from/emailAddress/address eq 'someone@company.com'"
    • "categories/any(a:a eq 'Red category')"
  • Top - The maximum number of emails to retrieve. This field supports only integer and Int32 variables. The default value is 50 (not shown).
Output
  • Result - Returns all emails from the user's inbox. This field supports only Office365Message[] variables. Required if you plan to use the output data in subsequent activities.

    The variable you create for this property is also used in the Forward Mail and Move Mail activities (as the Message input property value). When using this variable as an input property value, specify the item in the array that you want to use (e.g., foundMessages(0)).

    The Office365Messageobject includes multiple properties that you can use in other activities.
    The Body.Content property is returned in HTML format only.

How it works

The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.

  1. Complete the steps.
  2. Add the Microsoft Office 365 Scope activity to your project.
  3. Add the Get Mail activity inside the Microsoft Office 365 Scope activity.
  4. Enter values for the Input properties.
  5. Create and enter a Office365Message[] variable for your Output property.
  6. Run the activity.

    • Your input property values are sent to the GetMessage and ListMessages APIs.
    • The API returns the Office365Message[] value to your output property variable.


  • Description
  • Project compatibility
  • Configuration
  • How it works

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.