RetrieveSingleMessage Method


Retrieves a message from the e-mail account.

No messages are deleted by this method.

To retrieve all messages, use RetrieveMessages method.


objMessage = ObjectName.RetrieveSingleMessage(Index)  
Parameters:  
Index As Long Index of the message to retrieve. Allowed range is: 1 <= Index <= POP3.MessageCount
 
Return value As Message Message object filled with all message information. If error has occurred, return value is Nothing.  

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 "Body: " & Msg.BodyText
    End If
  End If
  Mailer.Disconnect
End If

See Also:

RetrieveSingleMessageHeaders Method
RetrieveHeaders Method
RetrieveMessages Method
Message Object


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