Click or drag to resize
MimeKit

IMailStoreGetFoldersAsync(FolderNamespace, StatusItems, Boolean, CancellationToken) Method

Asynchronously get all of the folders within the specified namespace.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.7.1
Syntax
C#
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 true, only subscribed folders will be listed.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskIListIMailFolder
The folders.
Exceptions
ExceptionCondition
ArgumentNullExceptionnamespace is null.
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.
Remarks
Asynchronously gets all of the folders within the specified namespace.
See Also