ReadEmail
Read Microsoft Exchange emails and downloading their attachments.
Task version: 1.5.0
Required Frends version: 5.5+
Required .NET version: 6.0
Compatible Agents: Crossplatform
Source code: https://github.com/FrendsPlatform/Frends.Exchange
Task Parameters
AuthenticationProvider : AuthenticationProviders
Specifies the type of authentication provider to use for the connection.
Possible values:
ClientCredentialsCertificate: Specifies the type of authentication provider to use for the connection.ClientCredentialsSecret: Specifies the type of authentication provider to use for the connection.UsernamePassword: Specifies the type of authentication provider to use for the connection.
Default: 2
Example: AuthenticationProviders.UsernamePassword
X509CertificateFilePath : String
Specifies the path to a file that contains both the client certificate and private key.
Default: -
Example: C:\Certificates\mycert.pfx
🗝ClientSecret : String
Specifies the secret key of the client application.
Default: -
Example: Y2lzY29zeXN0ZW1zOmMxc2Nv
Username : String
Specifies the username of the user.
Default: -
Example: johndoe@example.com
🗝Password : String
Specifies the password of the user.
Default: -
Example: SecurePassword123
ClientId : String
Specifies the app ID for fetching an access token.
This is the unique identifier for your application.
Default: -
Example: 4a1aa1d9-c16a-40a2-bd7d-2bd40babe4ff
TenantId : String
Specifies the tenant ID for fetching an access token.
This is the unique identifier of your Azure AD tenant.
Default: -
Example: 9188040d-6c67-4c5b-b112-36a304b66dad
Mailbox : String
Mailbox from where the emails will be read.
If empty and using UsernamePassword authentication, the authenticated user's mailbox will be used.
If empty and using ClientCredentials authentication, Input.From will be used as fallback.
Default: -
Example: johndoe@example.com
From : String
User entity to get emails from. Can be left empty to use default user.
Default: -
Example: johndoe@example.com
Select : String
Select properties to be returned.
Default: -
Example: subject,body,bodyPreview,uniqueBody,hasAttachments
Filter : String
Filter items by property values.
Default: -
Example: 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
Skip : Nullable<Int32>
Skip the first n items.
Default: -
Example: 10
Top : Int32
Limits the result to the first n items. If set to 0, all items are returned.
Default: 0
Example: 10
Orderby : String
Order items by property values.
Default: -
Example: receivedDateTime DESC,subject ASC
Expand : String
Expand related entities.
Default: -
Example: attachments
UpdateReadStatus : Boolean
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.
Default: True
Example: true
Headers : HeaderParameters[]
Header parameters.
Default: -
Example: { [ "Prefer", "outlook.body-content-type="text"" ] }
DownloadAttachments : Boolean
Specifies whether to download attachments.
Default: True
Example: true
DestinationDirectory : String
Specifies the directory where the downloaded attachments will be stored.
Default: -
Example: C:\Users\username\Downloads
CreateDirectory : Boolean
Create directory where the downloaded attachments will be stored.
Default: -
Example: -
FileExistHandler : FileExistHandlers
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: 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).
Rename: 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).
Append: 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).
OverWrite: 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).
Default: 0
Example: FileExistHandlers.Skip
DeleteReadEmails : Boolean
If true, then received emails will be hard deleted.
Default: False
Example: false
ThrowExceptionOnFailure : Boolean
Gets or sets a value indicating whether an error should stop the task and throw an exception.
If set to true, an exception will be thrown when an error occurs. If set to false, Task will try to continue and the error message will be added into Result.ErrorMessages and Result.Success will be set to false.
Default: True
Example: true
Task Result
Success : Boolean
Gets a value indicating whether the task was executed successfully.
Example: true
Data : List<ResultObject>
Gets the result of the task. Contains exception message if exception was thrown and Options.ThrowExceptionOnFailure = false.
Example: { "AAMkADIxYTJiZDIz", "C:\temp\file.txt", 6000, "#microsoft.graph.fileAttachment", "This is content." }
ErrorMessages : List<Object>
Error messages.
Example: { "error occured", "another error occured." }
Task Changelog
Changelog for Task Frends.Exchange.ReadEmail.
[1.5.0] - 2026-05-07
Added
Added
Mailboxparameter toConnectionto allow reading emails from a mailbox different than the authenticated user. ForUsernamePasswordauthentication, ifMailboxis empty, the authenticated user's mailbox is used. ForClientCredentialsauthentication, ifMailboxis empty,Input.Fromis used as fallback.
[1.4.0] - 2026-03-20
Added
Added DeleteReadEmails option to permanently delete emails after they are read and processed.
[1.3.0] - 2025-10-17
Changed
Changed ClientSecret to a password property.
[1.2.0] - 2024-08-22
Changed
Updated the Azure.Identity, Newtonsoft.Json and Mimekit libraries to their latest versions.
[1.1.0] - 2023-05-24
Fixed
Skip parameter is null instead of zero when it is not supported
[1.0.0] - 2023-05-12
Added
Initial implementation
Last updated
Was this helpful?

