Outlook 365 — Get email by ID
Outlook 365 — Get email by ID
Section titled “Outlook 365 — Get email by ID”Type: outlook365-get-email · Package: Outlook 365 v1.0.4 · Output: Dictionary<string,object>
Gets a full email by its ID: body, sender, recipients, subject, date and metadata. Use it when Get emails gave you the list without bodies and you now need the content of a specific one.
How it works
Section titled “How it works”It works on the session created with Outlook 365 — Connect. Pass it in the session parameter, or place this activity inside the body of Outlook 365 — Connect to inherit it automatically.
The id is the one in each item returned by Get emails (id key) or the one returned by Move. It only reads: it does not mark the email as read.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | Message ID. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanOutlookMailSession | — | Outlook 365 — Connect session (inherited inside body). |
Output
Section titled “Output”Returns a Dictionary<string,object> with the same keys as each item of Get emails, always including the body:
| Key | Type | Content |
|---|---|---|
id, subject, from, fromName | string | ID, subject, sender address and name. |
to, cc | List<string> | Recipient and Cc addresses. |
receivedDateTime | string | Received time in ISO 8601, UTC. |
preview | string | First characters of the body as plain text. |
isRead, hasAttachments | bool | Read / has attachments. |
categories | List<string> | Assigned categories. |
webLink | string | Link to the email in Outlook on the web. |
body | string | Full body content. |
bodyType | string | Html or Text: how to interpret body. Outlook emails are usually Html; for clean text use preview or strip the tags. |
It does not include internet headers or attachment contents; to save attachments use Download attachments.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'id' is required. | id is empty or the expression returned null. |
Graph error ErrorItemNotFound | The email does not exist in the mailbox: it was deleted, or moved and its ID changed. Use the id returned by Move. |
No Outlook 365 session available. … | You didn’t pass session and the activity is not inside Connect’s body. |
Example
Section titled “Example”Outlook 365 — Connect credential = credential("m365-support") └─ body: Outlook 365 — Get emails unreadOnly = true → output: newEmails For each item in newEmails └─ Outlook 365 — Get email by ID id = item["id"] → output: email AI Extract prompt = str(email["body"]) schema = … → output: dataRelated activities
Section titled “Related activities”- Outlook 365 — Get emails — get the list and its IDs.
- Outlook 365 — Reply — reply to the email.
- Outlook 365 — Download attachments — save its attachments.
- All Outlook 365 activities