# Get Email By Id

> `UiPath.Mail.Activities.Business.GetEmailById`

`UiPath.Mail.Activities.Business.GetEmailById`

:::important
The new version of the Outlook application impacts this activity. For more details, check [New Outlook impact on UiPath Outlook Desktop activities](https://docs.uipath.com/activities/other/latest/productivity/new-outlook-impacts-outlook-desktop-activities#new-outlook-impact-on-uipath-outlook-desktop-activities).
:::

Retrieves the email with the specified ID. This activity must be added inside a [Use Outlook 365](https://docs.uipath.com/activities/other/latest/productivity/exchange-application-card), [Use Gmail](https://docs.uipath.com/activities/other/latest/productivity/gmail-application-card), or [Use Desktop Outlook App](https://docs.uipath.com/activities/other/latest/productivity/outlook-application-card) activity.

## Configuring the activity

#### In the body of the activity

* **Account** - The account to search in. In StudioX, select **Plus** on the right side of the field and then, from the drop-down menu, select an Outlook 365, Gmail, or desktop Outlook account added to the automation.
* **Email ID** - The ID of the email to look for. In StudioX, select **Plus** on the right side of the field and then, from the drop-down menu, use one of the available options to select the ID:

  + Data from the Project Notebook, a parent Excel file or Outlook account. For example, select an Excel file, and then select **Indicate in Excel** to indicate a cell from the file, or select an email in Outlook and then select a field in the email that contains the ID.
  + **Use Variable** - Select a variable that you previously created in the project.
  + **Text** - Enter an email ID in the Text Builder.
  + **Ask when run** - Prompt for the ID when the project is executed.
  + **Paste from clipboard** - Paste a value that you previously copied to the clipboard in the project.
  + **Open in Advanced Editor** - Enter a VB expression.
* **Reference as** - The name used to refer to the retrieved email in other activities. In StudioX, select **Plus** on the right side of the field and then, from the drop-down menu, use one of the available options:

  + **Create Variable** - Creates a new variable in the project to store the email from the activity.
  + **Use Variable** - Select a variable that you previously created in the project to store the email from the activity.

#### Properties panel

**Common**

* **DisplayName** - The display name of the activity.

**Input**

* Check the options in the body of the activity.
  :::note
  * The value for **Email ID** can can be retrieved from the `MailMessage.Headers("Uid")` object or from the `UiPathEventObjectId` project argument if an Integration Service trigger is used.
  * When used with the [Use Outlook 365](https://docs.uipath.com/activities/other/latest/productivity/exchange-application-card) activity, value retrieval from the `UiPathEventObjectId` argument is not supported on Windows-Legacy projects.
  :::

**Misc**

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

**Output**

* Check the options in the body of the activity.
