Imap ClientGet Folders(Folder Namespace, Status Items, Boolean, Cancellation Token) Method
Get all of the folders within the specified namespace.
Definition
Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
The folders.
IMailStoreGetFolders(FolderNamespace, StatusItems, Boolean, CancellationToken)
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override IList<IMailFolder> GetFolders(
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
IListIMailFolderThe folders.
Implements
IMailStoreGetFolders(FolderNamespace, StatusItems, Boolean, CancellationToken)IMailStoreGetFolders(FolderNamespace, StatusItems, Boolean, CancellationToken)
Remarks
Gets all of the folders within the specified namespace.
Exceptions
| ArgumentNullException | namespace is . |
| 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. |