-
-
Notifications
You must be signed in to change notification settings - Fork 10
Working With MailFolders
Daniel Collingwood edited this page Aug 7, 2024
·
7 revisions
Here are a few different ways:
- (version 2.11.9 and beyond)
var mailFolder = await _imapReceiver.MailFolderClient.GetFolderAsync(mailFolderName, createIfNotFound: true, cancellationToken);
- (version 2.10.0 and beyond)
var mailFolder = await _imapReceiver.MailFolderClient.GetFolderAsync([mailFolderName], cancellationToken);
- (version 2.10.0 and 2.11.9 only)
var mailFolder = await mailFolder.GetOrCreateSubfolderAsync(mailFolderName, cancellationToken);
await _imapReceiver.MailFolderClient.DraftsFolder.AppendAsync(mimeMessage, cancellationToken: cancellationToken);
await _imapReceiver.MailFolderClient.AppendSentMessageAsync(mimeMessage, MessageFlags.Seen, cancellationToken);
Here are a few different ways:
- (version 2.11.9 and beyond)
var destinationFolder = await mailFolderClient.GetFolderAsync(mailFolderFullName, createIfNotFound: true, cancellationToken);
var uniqueId = await mailFolderClient.MoveToAsync(messageSummary, destinationFolder, cancellationToken);
- (version 2.10.0 and beyond)
var uniqueId = await mailFolderClient.MoveToAsync(messageSummary.UniqueId, destinationFolderFullName, cancellationToken);
- (version 2.10.0 and beyond)
await _imapReceiver.MailFolderClient.MoveToAsync(messageSummary, SpecialFolder.Sent, cancellationToken);