# Get Emails

Get emails via Exchange.

<table data-header-hidden><thead><tr><th width="214"></th><th width="342"></th></tr></thead><tbody><tr><td>Server</td><td>[Text] EWS Exchange Server. Default server: <code>https://&#x3C;mail-server>/ews/exchange.asmx</code></td></tr><tr><td>Domain</td><td>[Text] Domain for authentication on the server.</td></tr><tr><td>Username</td><td>[Text] Username for authentication on the server.</td></tr><tr><td>User Password</td><td>[Text/SecureString] User password for authentication on the server.</td></tr><tr><td>Version</td><td>Exchange version.</td></tr><tr><td>Folder Name</td><td>[Text] Name of the folder in Exchange. For example: "Inbox" or "Inbox". If necessary, specify nested folders using the character '<code>\</code>'. For example: "<code>Inbox\TestFolder</code>".</td></tr><tr><td>Shared Mailbox</td><td>[Text] Shared mailbox of the account. For example "secondemail@domain.com".</td></tr><tr><td>Number of Emails</td><td>[Number] The number of the most recent received emails to be added to the final list.</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. 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: <code>$Result[0].Sender.Address</code></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. Possible values:</p><ul><li>"Default" - default;</li><li>"Release" - output disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</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/exchange-exchange-automation/poluchit-pisma-getexchangemailmessages.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.
