Click or drag to resize
MimeKit

IMailFolderOpenAsync(FolderAccess, UInt32, UInt64, IListUniqueId, CancellationToken) Method

Asynchronously opens the folder using the requested folder access.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.3.0
Syntax
C#
Task<FolderAccess> OpenAsync(
	FolderAccess access,
	uint uidValidity,
	ulong highestModSeq,
	IList<UniqueId> uids,
	CancellationToken cancellationToken = default
)

Parameters

access  FolderAccess
The requested folder access.
uidValidity  UInt32
The last known UidValidity value.
highestModSeq  UInt64
The last known HighestModSeq value.
uids  IListUniqueId
The last known list of unique message identifiers.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskFolderAccess
The FolderAccess state of the folder.
Remarks

This variant of the OpenAsync(FolderAccess, CancellationToken) method is meant for quick resynchronization of the folder. Before calling this method, the EnableQuickResync(CancellationToken) method MUST be called.

You should also make sure to add listeners to the MessagesVanished and MessageFlagsChanged events to get notifications of changes since the last time the folder was opened.

See Also