UIDNext Property


Gets the UID to be assigned to the next message in the currently selected mailbox.

A 32-bit positive value containing the UIDNEXT of the currently selected mailbox, or 0 if it's not available or no mailbox is selected.

This value, if available, allows the application to predict the UID value that will be assigned to a new message in the mailbox.


Value Type: Long
Parameters: None 
Remarks: This property is read-only.

Usage example:

' This sample writes the UIDVALIDITY value of the 'Inbox' mailbox

Dim Mailer
' Using visual basic to create object
Set Mailer = CreateObject("MailBee.IMAP4")
' Using ASP to create object
' Set Mailer = Server.CreateObject("MailBee.IMAP4")
' In ASP use Response.Write instead of MsgBox

' Start logging of all the events
Mailer.EnableLogging = True
Mailer.LogFilePath = "C:\Temp\imap4_log.txt"
Mailer.ClearLog
Mailer.LicenseKey = "put your license key here"
If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then
   ' Select necessary mailbox first
   If Mailer.SelectMailbox("Inbox") Then
      MsgBox "UIDNEXT = " & Mailer.UIDNext
   Else
      MsgBox "Error."
   End If
   Mailer.Disconnect
Else
   MsgBox "Unable to connect."
End If

See Also:

Selected Property | SelectMailbox Method | IMAP4 Object


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.