smtp_class::pop_before_smtp PHP Méthode

pop_before_smtp() public méthode

Pop before smtp authentication
public pop_before_smtp ( $hostname, $username, $password )
    function pop_before_smtp($hostname, $username, $password)
    {
        global $user;
        if (!($this->socket = @fsockopen($hostname, 110, $errno, $errstr, 10))) {
            if ($errstr) {
                $errstr = utf8_convert_message($errstr);
            }
            return isset($user->lang['NO_CONNECT_TO_SMTP_HOST']) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : {$errno} : {$errstr}";
        }
        $this->server_send("USER {$username}", true);
        if ($err_msg = $this->server_parse('+OK', __LINE__)) {
            return $err_msg;
        }
        $this->server_send("PASS {$password}", true);
        if ($err_msg = $this->server_parse('+OK', __LINE__)) {
            return $err_msg;
        }
        $this->server_send('QUIT');
        fclose($this->socket);
        return false;
    }