Click or drag to resize
MimeKit

ImapClientGetFoldersAsync Method (FolderNamespace, StatusItems, Boolean, CancellationToken)

Asynchronously get all of the folders within the specified namespace.

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

Parameters

namespace
Type: MailKitFolderNamespace
The namespace.
items (Optional)
Type: MailKitStatusItems
The status items to pre-populate.
subscribedOnly (Optional)
Type: SystemBoolean
If set to true, only subscribed folders will be listed.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskIListIMailFolder
The folders.

Implements

IMailStoreGetFoldersAsync(FolderNamespace, StatusItems, Boolean, CancellationToken)
IMailStoreGetFoldersAsync(FolderNamespace, StatusItems, Boolean, CancellationToken)
Exceptions
ExceptionCondition
ArgumentNullExceptionnamespace is null.
ObjectDisposedException The ImapClient has been disposed.
ServiceNotConnectedException The ImapClient is not connected.
ServiceNotAuthenticatedException The ImapClient is not authenticated.
OperationCanceledException The operation was canceled via the cancellation token.
FolderNotFoundException The namespace folder could not be found.
IOException An I/O error occurred.
ImapCommandException The server replied to the LIST or LSUB command with a NO or BAD response.
ImapProtocolException The server responded with an unexpected token.
Remarks
Gets all of the folders within the specified namespace.
See Also