Click or drag to resize
MimeKit

MailStoreGetFoldersAsync(FolderNamespace, StatusItems, Boolean, CancellationToken) Method

Asynchronously get all of the folders within the specified namespace.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.10.0
Syntax
C#
public abstract Task<IList<IMailFolder>> GetFoldersAsync(
	FolderNamespace namespace,
	StatusItems items = StatusItems.None,
	bool subscribedOnly = false,
	CancellationToken cancellationToken = default
)

Parameters

namespace  FolderNamespace
The namespace.
items  StatusItems  (Optional)
The status items to pre-populate.
subscribedOnly  Boolean  (Optional)
If set to , only subscribed folders will be listed.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskIListIMailFolder
The folders.

Implements

IMailStoreGetFoldersAsync(FolderNamespace, StatusItems, Boolean, CancellationToken)
Exceptions
ExceptionCondition
ArgumentNullExceptionnamespace is .
ObjectDisposedException The MailStore has been disposed.
ServiceNotConnectedException The MailStore is not connected.
ServiceNotAuthenticatedException The MailStore is not authenticated.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
ProtocolException A protocol error occurred.
CommandException The command failed.
Remarks
Asynchronously gets all of the folders within the specified namespace.
See Also