Count Property


Returns the number of Envelope objects in the collection.


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

Usage example:

' This sample iterates envelope collection in reverse order
Dim Mailer, Envelopes, I
'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
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
  If Mailer.SelectMailbox("Inbox") Then
    Set Envelopes = Mailer.RetrieveEnvelopes(1, Mailer.MessageCount, False)
    If Not Envelopes Is Nothing Then
      For I = Envelopes.Count To 1 Step -1
        MsgBox Envelopes(I).Subject
      Next
    End If
  End If
  Mailer.Disconnect
End I

See Also:

Item Property

Envelope Object

Envelopes Collection


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