Size Property


Returns the message size (in bytes).

This property is always set to right value even if only message headers are received (i.e. if RetrieveSingleMessageHeaders or RetrieveHeaders method was used). So, Size property might be not equal to Len(RawBody) if only headers are received.

Note: To get message size, it's not even required to download message headers. POP3 object gets messages sizes during connection stage. Once Connect method finished, you may get particular message size using POP3.Size(Index) property.


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

Usage example:

Dim Mailer, Msg
'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"
Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword"
If Mailer.Connected Then
   If Mailer.MessageCount > 0 Then
      Set Msg = Mailer.RetrieveSingleMessage(1)
      If Not Msg Is Nothing Then MsgBox "Message size = " & Msg.Size & " bytes"
   End If
   Mailer.Disconnect
End If

See Also:

Message Object


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