MAILKIT 如何将消息移动到文件夹并获取新的 UniqueID
MAILKIT how to Move Messages to folder a get the new UniqueID
MailKit.Net.Imap 有 MoveTo(...)。但是如果我们移动消息,消息将获得新的 UniqueID(因为它在文件夹中是唯一的)。如何获取消息的新 UniqueID?
采用 UID(或 UID 列表)的 MoveTo 方法将 return 目标文件夹中邮件的 UID。
var uidMap = folder.MoveTo (uids, destination);
foreach (var uid in uids) {
Console.WriteLine ("The message with a UID of {0} in {1} is now {2} in {3}",
uid, folder.FullName, uidMap[uid], destination.FullName);
}
MailKit.Net.Imap 有 MoveTo(...)。但是如果我们移动消息,消息将获得新的 UniqueID(因为它在文件夹中是唯一的)。如何获取消息的新 UniqueID?
采用 UID(或 UID 列表)的 MoveTo 方法将 return 目标文件夹中邮件的 UID。
var uidMap = folder.MoveTo (uids, destination);
foreach (var uid in uids) {
Console.WriteLine ("The message with a UID of {0} in {1} is now {2} in {3}",
uid, folder.FullName, uidMap[uid], destination.FullName);
}