OnMessageComplete Event


Fires when POP3 object has finished Message object creation. After firing this event POP3 object will return newly created Message object to the caller code (or in the case of RetrieveMessages and RetrieveHeaders methods POP3 object will start retrieving next message).


Parameters:  
Index As Long Index of the message being retrieved. Allowed range is: 1 <= Index <= POP3.MessageCount  
ByRef Proceed As Boolean Default value is True, which tells MailBee to return Message object. You can set it to False to immediately abort POP3 session, disconnect from POP3 server and return Nothing  
Remarks: Events are turned off by default. To enable them, set EnableEvents to True

Usage example:

Option Explicit
Dim WithEvents objPOP3 As MailBee.POP3

Private Sub Form_Load()
  Dim Msgs As MailBee.Messages
  Set objPOP3 = New MailBee.POP3
  objPOP3.LicenseKey = "put your license key here"
  objPOP3.EnableEvents = True
  If objPOP3.Connect ("mailserver.com", 110, "MyName", "MyPassword") Then
    Set Msgs = objPOP3.RetrieveHeaders
    objPOP3.Disconnect
  End If
End Sub

Private Sub objPOP3_OnMessageComplete(ByVal Index As Long, Proceed As Boolean)
  ' Abort pop3 session if there are more than 100 messages in the mailbox
  If Index > 100 Then Proceed = False 
End Sub

See Also:

EnableEvents Property
OnReceiveStart Event
OnReceiveProgress Event
OnReceiveComplete Event


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