POP3::send_cmd()publicWP 1.0

Method of the class: POP3{}

No Hooks.

Return

null. Nothing (null).

Usage

$POP3 = new POP3();
$POP3->send_cmd ( $cmd );
$cmd **
-
Default: ""

POP3::send_cmd() code WP 6.4.3

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;
}