SMTP::SendHello PHP Method

SendHello() private method

Sends a HELO/EHLO command.
private SendHello ( $hello, $host ) : boolean
return boolean
    private function SendHello($hello, $host)
    {
        fwrite($this->smtp_conn, $hello . ' ' . $host . $this->CRLF);
        $rply = $this->get_lines();
        $code = substr($rply, 0, 3);
        if ($this->do_debug >= 2) {
            echo 'SMTP -> FROM SERVER: ' . $rply . $this->CRLF . '<br />';
        }
        if ($code != 250) {
            $this->error = array('error' => $hello . ' not accepted from server', 'smtp_code' => $code, 'smtp_msg' => substr($rply, 4));
            if ($this->do_debug >= 1) {
                echo 'SMTP -> ERROR: ' . $this->error['error'] . ': ' . $rply . $this->CRLF . '<br />';
            }
            return false;
        }
        $this->helo_rply = $rply;
        return true;
    }