Disconnect Method


Disconnects from the POP3 server.

It is not necessary (though it's recommended) to call this method. The POP3 object automatically disconnects from the POP3 server when the object is to be freed.


blnResult = ObjectName.Disconnect  
Parameters: None 
Return value As Boolean True if successful, False if disconnect procedure failed (was not connected, mail server is not responding). You can check ErrDesc property or log file to get more detailed error information  
Remarks: Even if this method failed, connection will be closed anyway. This means that Connected property will be always False after calling Disconnect method. However, only if connection was closed gracefully (Disconnect method returned True), messages marked for deletion by DeleteMessage will be really deleted

Usage example:

Dim Mailer
'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"
If Mailer.Connect ("mailserver.com", 110, "MyName", "MyPassword")
  If Mailer.Disconnect Then
    MsgBox "Connection gracefully closed"
  Else
    MsgBox "Connection aborted"
  End If
End If

See Also:

Connect Method
DeleteMessage Method


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