POP3::Login PHP Method

Login() public method

Login to the POP3 server (does not support APOP yet)
public Login ( string $username = '', string $password = '' ) : boolean
$username string
$password string
return boolean
    public function Login($username = '', $password = '')
    {
        if ($this->connected == false) {
            $this->error = 'Not connected to POP3 server';
            if ($this->do_debug >= 1) {
                $this->displayErrors();
            }
        }
        if (empty($username)) {
            $username = $this->username;
        }
        if (empty($password)) {
            $password = $this->password;
        }
        $pop_username = "USER {$username}" . $this->CRLF;
        $pop_password = "PASS {$password}" . $this->CRLF;
        //  Send the Username
        $this->sendString($pop_username);
        $pop3_response = $this->getResponse();
        if ($this->checkResponse($pop3_response)) {
            //  Send the Password
            $this->sendString($pop_password);
            $pop3_response = $this->getResponse();
            if ($this->checkResponse($pop3_response)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }