Skip to content

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.

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.

ParameterTypeDefaultDescription
idstring—Message ID.
ParameterTypeDefaultDescription
sessionZoanOutlookMailSession—Outlook 365 — Connect session (inherited inside body).

Returns a Dictionary<string,object> with the same keys as each item of Get emails, always including the body:

KeyTypeContent
id, subject, from, fromNamestringID, subject, sender address and name.
to, ccList<string>Recipient and Cc addresses.
receivedDateTimestringReceived time in ISO 8601, UTC.
previewstringFirst characters of the body as plain text.
isRead, hasAttachmentsboolRead / has attachments.
categoriesList<string>Assigned categories.
webLinkstringLink to the email in Outlook on the web.
bodystringFull body content.
bodyTypestringHtml 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.

MessageCause and fix
'id' is required.id is empty or the expression returned null.
Graph error ErrorItemNotFoundThe 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.
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: data