PHPMailer\PHPMailer

POP3::disconnectpublicWP 1.0

Disconnect from the POP3 server.

Method of the class: POP3{}

No Hooks.

Returns

null. Nothing (null).

Usage

$POP3 = new POP3();
$POP3->disconnect();

POP3::disconnect() code WP 7.0

public function disconnect()
{
    // If could not connect at all, no need to disconnect
    if ($this->pop_conn === false) {
        return;
    }

    $this->sendString('QUIT' . static::LE);

    // RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
    // Try to get it.  Ignore any failures here.
    try {
        $this->getResponse();
    } catch (Exception $e) {
        //Do nothing
    }

    //The QUIT command may cause the daemon to exit, which will kill our connection
    //So ignore errors here
    try {
        @fclose($this->pop_conn);
    } catch (Exception $e) {
        //Do nothing
    }

    // Clean up attributes.
    $this->connected = false;
    $this->pop_conn  = false;
}