Exchange

Frends.Exchange.ReadEmail / 2.0.0

Summary

Reads a mailbox through Microsoft Graph, optionally saving attachments to disk, and narrows what it fetches server-side by sender, filter and ordering rather than pulling everything down first.

Typical use — mail-triggered integrations, where filtering at the server is what keeps a busy mailbox from dominating the run

Details

Frends version
5.7 and newer
Agent
Crossplatform
Target framework
net8.0

Email content.

Name Type Default Example Description
From String – johndoe@example.com

User entity to get emails from. Can be left empty to use default user.

Select String – subject,body,bodyPreview,uniqueBody,hasAttachments

Select properties to be returned.

Filter String – parentFolderId eq 'INBOX' and from/emailAddress/address eq 'user@exampledomain.com' and subject eq 'This is subject' and isRead eq true and hasAttachments eq true

Filter items by property values.

Skip Nullable<Int32> – 10

Skip the first n items.

Top Int32 0 10

Limits the result to the first n items. If set to 0, all items are returned.

Orderby String – receivedDateTime DESC,subject ASC

Order items by property values.

Expand String – attachments

Expand related entities.

UpdateReadStatus Boolean True true

Specifies whether to mark an email as read after processing it. If set to true, the email will be marked as read in the mailbox. If set to false, the email's read status will remain unchanged.

Headers HeaderParameters[] – { [ "Prefer", "outlook.body-content-type=\"text\"" ] }

Header parameters.

DownloadAttachments Boolean True true

Specifies whether to download attachments.

DestinationDirectory String – C:\\Users\\username\\Downloads

Specifies the directory where the downloaded attachments will be stored.

CreateDirectory Boolean – true

Create directory where the downloaded attachments will be stored.

FileExistHandler FileExistHandlers Skip FileExistHandlers.Skip

Specifies the action to take when a file with the same name already exists in the destination directory. If FileExistHandler.Rename is selected, an unique number will be appended to the name of the file to be downloaded (e.g., file(2).txt).

Possible values:

  • Skip: Skip the file creation.

  • Rename: Rename the file by appending a unique number.

  • Append: Append to the existing file.

  • OverWrite: Overwrite the existing file.

An unhandled error has occurred. Reload 🗙