ImapClientGetFolder(String, CancellationToken) Method

Get the folder for the specified path.

Definition

Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override IMailFolder GetFolder(
	string path,
	CancellationToken cancellationToken = default
)

Parameters

path  String
The folder path.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

IMailFolder
The folder.

Implements

IMailStoreGetFolder(String, CancellationToken)
IMailStoreGetFolder(String, CancellationToken)

Remarks

Gets the folder for the specified path.

Exceptions

ArgumentNullException path 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 folder could not be found.
IOException An I/O error occurred.
ImapCommandException The server replied to the LIST command with a NO or BAD response.
ImapProtocolException The server responded with an unexpected token.

See Also