activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity activities

Last updated Feb 19, 2026

GetMessagesAsync

Retrieve email messages asynchronously.

Namespace: UiPath.Mail.Activities.Api

Assembly: UiPath.Mail.Activities.Api (in UiPath.Mail.Activities.Api.dll)

Overloads

OverloadDescription
GetMessagesAsync(CancellationToken)Asynchronously retrieve email messages.
GetMessagesAsync(GetMailOptions, CancellationToken)Asynchronously retrieve email messages with additional options.

GetMessagesAsync(CancellationToken)

Retrieve email messages asynchronously.

Task<IReadOnlyCollection<MailMessage>> GetMessagesAsync(
	CancellationToken token
)
Task<IReadOnlyCollection<MailMessage>> GetMessagesAsync(
	CancellationToken token
)

token CancellationToken : The token for the cancel operation.

GetMessagesAsync(GetMailOptions, CancellationToken)

Retrieve email messages asynchronously with additional options.

Task<IReadOnlyCollection<MailMessage>> GetMessagesAsync(
	GetMailOptions options,
	CancellationToken token
)
Task<IReadOnlyCollection<MailMessage>> GetMessagesAsync(
	GetMailOptions options,
	CancellationToken token
)

options GetMailOptions : Additional options to customize the retrieval of mails:

* `Top` - The number of messages to retrieve starting from the top of the list.
* `Top` - The number of messages to retrieve starting from the top of the list.

token CancellationToken : The token for the cancel operation.

Return value

Task<IReadOnlyCollection<MailMessage>>

The retrieved messages as a collection of MailMessage objects.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2026 UiPath. All rights reserved.