MailMessageUidOnServer Property
Gets Unique-ID (UID) of the message in the mailbox on the server.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public Object UidOnServer { get; }

Property Value

Type: Object
Returns a null reference (Nothing in Visual Basic) if the message was not received from the mail server; if received from IMAP4 server, returns a long value (Int64) containing positive 32bit value of IMAP4 UID, or -1 if UID could not be retrieved; if received from POP3 server, returns a string containing POP3 UID of this message, or a null reference if the UID value is not available.
Remarks
By default, MailBee does not download the list of POP3 UIDs unless any method which accesses UIDs (such as GetMessageUids) is called. To make sure UIDs are downloaded, set Uidl flag in InboxPreloadOptions property value prior to connecting to the POP3 server. However, some old POP3 servers do not support UIDs, and thus this property will still return null if UIDs are not supported by the server.
Note Note
The developer should use type casting from Object when using this property.
Examples
This sample shows how to obtain UID values of two messages (one received from POP3 server while another - from IMAP4 server).
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// Assume msgPop3 and msgImap are MailMessage objects which already
// have been received from POP3 and IMAP4 servers.
string pop3Uid = (string)msgPop3.UidOnServer;
long imapUid = (long)msgImap.UidOnServer;
See Also