Click or drag to resize
MimeKit

ImapClientGetFolderAsync Method

Asynchronously get the folder for the specified path.

Namespace:  MailKit.Net.Imap
Assembly:  MailKit (in MailKit.dll) Version: 2.14.0
Syntax
C#
public override Task<IMailFolder> GetFolderAsync(
	string path,
	CancellationToken cancellationToken = default
)

Parameters

path
Type: SystemString
The folder path.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskIMailFolder
The folder.

Implements

IMailStoreGetFolderAsync(String, CancellationToken)
IMailStoreGetFolderAsync(String, CancellationToken)
Exceptions
ExceptionCondition
ArgumentNullExceptionpath 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 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.
Remarks
Gets the folder for the specified path.
See Also