Ping Method


Sends "NOOP" command to the IMAP4 server.

You can use this method to keep connection with the IMAP4 server alive.

Also, this method updates values of MessageCount and RecentCount properties. These values can accidentally change when another user simultaneously accesses the same mailbox. In such a case IMAP4 object will fire OnStatusChange event (if EnableEvents=True).


blnResult = ObjectName.Ping  
Parameters: None 
Return value As Boolean True if successful, False if error has occurred (usually connection failure)  

Usage example:

Dim Mailer
'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.LicenseKey = "put your license key here"
If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then
  ' Start doing some long-lasting job here
  Mailer.Ping ' Call Ping to remind the server about us
  ' Continue long-lasting job
  Mailer.Disconnect
End If

See Also:

EnableEvents Property
MessageCount Property
RecentCount Property

OnStatusChange Event


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