GetMessageNumberFromUID Method


Returns the ordinal position of a message given its Unique-ID.

To get the list of all UIDs in the mailbox, use Search method.


lngMessageNumber = ObjectName.GetMessageNumberFromUID(UID)  
Parameters: None 
UID As String Unique-ID of a message to return message number for  
Return value As Long If successful, ordinal position of given message in the mailbox (starting from 1). If given Unique-ID is not found, return value is 0. If error occurs, return value is -1.  

Usage example:

Dim Mailer, strUID
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
If Mailer.Connect("mailserver.com", 110, "MyName", "MyPassword") Then
  If Mailer.MessageCount > 0 Then

    ' Get Unique-ID of the message #1
    strUID = Mailer.GetMessageUID(1)

    ' Get and display message number of the message
    ' with given Unique-ID.
    ' Should display "1".
    MsgBox Mailer.GetMessageNumberFromUID(strUID)
  End If
  Mailer.Disconnect
End If

See Also:

GetMessageUID Method
Search Method


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