ImapUidNext Property
Gets the UID to be assigned to the next message in the currently selected folder.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public long UidNext { get; }

Property Value

Type: Int64
A 32-bit positive value containing the UIDNEXT of the currently selected folder, or 0 if it's not available or no folder is selected.
Remarks
This value, if available, allows the application to predict the UID value that will be assigned to a new message in the folder.

For instance, if the application is going to upload a message into the folder and wants to know the UID assigned to this message, it can obtain this information passing UidPlusResult object as result parameter of UploadMessage(MailMessage, String, String, String, Boolean, UidPlusResult) method.

However, if the server does not support UIDPLUS extension, this won't work. If the server lacks UIDPLUS support, the application can query UidNext before making upload. If it's non-zero, this will be a value of UID to be assigned to the uploaded message.

Note Note
UidNext value is updated ONLY when a folder gets selected. Thus, if any messages arrived into the folder after it was selected, UidNext won't reflect the next UID value any longer. To request the current UIDNEXT value explicitly, the application should obtain the current FolderStatus of the folder using GetFolderStatus(String) method. This approach also has another advantage: some servers do not report UIDNEXT value on folder selection but they always report it when folder status is requested.
See Also