Click or drag to resize
MimeKit

MailStoreGetFolders Method (FolderNamespace, StatusItems, Boolean, CancellationToken)

Get all of the folders within the specified namespace.

Namespace:  MailKit
Assembly:  MailKit (in MailKit.dll) Version: 2.10.0
Syntax
C#
public abstract IList<IMailFolder> GetFolders(
	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: IListIMailFolder
The folders.

Implements

IMailStoreGetFolders(FolderNamespace, StatusItems, Boolean, CancellationToken)
Exceptions
ExceptionCondition
ArgumentNullExceptionnamespace is null.
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
Gets all of the folders within the specified namespace.
See Also