Skip to main content

Find emails

List emails in a mail folder, newest first, optionally only unread or matching sender/subject text.

Command in the Microsoft 365 toolkit · id ooa.microsoft365/list_mail · 13 inputs, 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialNoMicrosoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
FolderStringNoinboxFolder id or well-known name: inbox, archive, sentitems, deleteditems.
Unread onlyBooleanNofalseOnly unread emails.
From containsStringNoSender contains this text; separate several with ; to match any of them.
Subject containsStringNoSubject contains this text; separate several with ; to match any of them.
Maximum resultsNumberNo50Maximum emails.
Read onlyBooleanNofalseOnly emails already read.
SinceDateTimeNoReceived on or after this time (UTC).
BeforeDateTimeNoReceived before this time (UTC).
Has attachments onlyBooleanNofalseOnly emails that have attachments.
Oldest firstBooleanNofalseReturn the oldest emails first instead of the newest.
MailboxStringNomeMailbox: me, or a user's email address (needs application permission).
Endpoint addressStringNohttps://graph.microsoft.com/v1.0Graph endpoint; change only for national clouds or testing.

Outputs​

OutputTypeWhat it is
tableTableColumns: id, from, subject, received, unread, has_attachments.
countNumberNumber of emails.