IMailStoreGetFoldersAsync(FolderNamespace, Boolean, CancellationToken) Method

Asynchronously get all of the folders within the specified namespace.

Definition

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
Task<IList<IMailFolder>> GetFoldersAsync(
	FolderNamespace namespace,
	bool subscribedOnly,
	CancellationToken cancellationToken = default
)

Parameters

namespace  FolderNamespace
The namespace.
subscribedOnly  Boolean
If set to , only subscribed folders will be listed.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskIListIMailFolder
The folders.

Remarks

Asynchronously gets all of the folders within the specified namespace.

Exceptions

ArgumentNullException namespace is .
ObjectDisposedException The IMailStore has been disposed.
OperationCanceledException The operation was canceled via the cancellation token.
ServiceNotConnectedException The IMailService is not connected.
ServiceNotAuthenticatedException The IMailService is not authenticated.
FolderNotFoundException The namespace folder could not be found.
IOException An I/O error occurred.
ProtocolException A protocol error occurred.
CommandException The command failed.

See Also