SlightPHP\SMTP::Verify PHP Method

Verify() public method

Returns false if the name could not be verified otherwise the response from the server is returned. Implements rfc 821: VRFY SMTP CODE SUCCESS: 250,251 SMTP CODE FAILURE: 550,551,553 SMTP CODE ERROR : 500,501,502,421
public Verify ( $name ) : integer
return integer
    public function Verify($name)
    {
        $this->error = null;
        // so no confusion is caused
        if (!$this->connected()) {
            $this->error = array("error" => "Called Verify() without being connected");
            return false;
        }
        fputs($this->smtp_conn, "VRFY " . $name . $this->CRLF);
        $rply = $this->get_lines();
        $code = substr($rply, 0, 3);
        if ($this->do_debug >= 2) {
            echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
        }
        if ($code != 250 && $code != 251) {
            $this->error = array("error" => "VRFY failed on name '{$name}'", "smtp_code" => $code, "smtp_msg" => substr($rply, 4));
            if ($this->do_debug >= 1) {
                echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
            }
            return false;
        }
        return $rply;
    }