MailMessageUidOnServer Property |
Gets Unique-ID (UID) of the message in the mailbox on the server.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public Object UidOnServer { get; }
Public ReadOnly Property UidOnServer As Object
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 |
---|
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).
using MailBee;
using MailBee.Mime;
string pop3Uid = (string)msgPop3.UidOnServer;
long imapUid = (long)msgImap.UidOnServer;
Imports MailBee
Imports MailBee.Mime
Dim pop3UID As String = CType(msgPop3.UidOnServer, String)
Dim imapUid As Long = CType(msgImap.UidOnServer, Long)
See Also