POP3::send_cmd()publicWP 1.0

Метод класса: POP3{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$POP3 = new POP3();
$POP3->send_cmd ( $cmd );
$cmd **
-
По умолчанию: ""

Код POP3::send_cmd() WP 6.6.2

function send_cmd ( $cmd = "" )
{
    //  Sends a user defined command string to the
    //  POP server and returns the results. Useful for
    //  non-compliant or custom POP servers.
    //  Do NOT include the \r\n as part of your command
    //  string - it will be appended automatically.

    //  The return value is a standard fgets() call, which
    //  will read up to $this->BUFFER bytes of data, until it
    //  encounters a new line, or EOF, whichever happens first.

    //  This method works best if $cmd responds with only
    //  one line of data.

    if(!isset($this->FP))
    {
        $this->ERROR = "POP3 send_cmd: " . _("No connection to server");
        return false;
    }

    if(empty($cmd))
    {
        $this->ERROR = "POP3 send_cmd: " . _("Empty command string");
        return "";
    }

    $fp = $this->FP;
    $buffer = $this->BUFFER;
    $this->update_timer();
    fwrite($fp,"$cmd\r\n");
    $reply = fgets($fp,$buffer);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
    return $reply;
}