Click or drag to resize
MimeKit

IMailStoreGetFolders 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#
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.
Exceptions
ExceptionCondition
ArgumentNullExceptionnamespace is null.
ObjectDisposedException The IMailService 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
Gets all of the folders within the specified namespace.
See Also