# Get Emails

Get emails through Outlook.

<table data-header-hidden><thead><tr><th width="225"></th><th width="334"></th></tr></thead><tbody><tr><td>Email</td><td>[Text] The email address from which to retrieve the list of recent emails.</td></tr><tr><td>Folder Name</td><td>[Text] The name of the folder in Outlook. For example: "Inbox" or "Inbox". If necessary, specify nested folders using the '\' character. For example: "Inbox\TestFolder".</td></tr><tr><td>Number of Emails</td><td>[Number] The number of recent received emails to add to the final list.</td></tr><tr><td>Filter</td><td>[Text] A filter for retrieving emails. The filter format corresponds to the format of the Items.Restrict method (Outlook). Examples can be seen in the expression editor in the "Filters for Outlook" category.</td></tr><tr><td>Only Unread</td><td>If enabled, only unread emails will be retrieved.</td></tr><tr><td>Mark as Read</td><td>If enabled, all retrieved unread messages will be marked as read.</td></tr><tr><td>Result</td><td><p>[List] Returns a list of MailItem objects, each representing an email with data. Indexing starts at zero.</p><p>Example of available properties:</p><ul><li>Body - plain text of the message;</li><li>HTMLBody - text of the message in HTML format;</li><li>Sender.Address - email of the sender;</li><li>Sender.Name - name of the sender (if available);</li><li>Subject - subject of the email.</li></ul><p>For example, to get the sender's email of the first message: $Result[0].Sender.Address</p></td></tr><tr><td>Error Handling Level</td><td><p>Select the error handling level. Possible values:</p><ul><li>"Default" - default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td>Message Level</td><td><p>Select the message level that blocks will output during operation.</p><p>Possible values:</p><ul><li>"Default" - default;</li><li>"Release" - output is disabled;</li><li>"Debug" - outputs main information;</li><li>"Detailed" - outputs detailed information.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td>Error Text</td><td>[Text] Returns detailed information about the error in case of incorrect execution of the block's work.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/spravochnik-blokov/outlook-outlook-automation/poluchit-pisma-getoutlookmailmessages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
