smtp_class::hello PHP Méthode

hello() protected méthode

SMTP EHLO/HELO
protected hello ( $hostname ) : mixed
Résultat mixed Null if the authentication process is supposed to continue False if already authenticated Error message (string) otherwise
    protected function hello($hostname)
    {
        // Try EHLO first
        $this->server_send("EHLO {$hostname}");
        if ($err_msg = $this->server_parse('250', __LINE__)) {
            // a 503 response code means that we're already authenticated
            if ($this->numeric_response_code == 503) {
                return false;
            }
            // If EHLO fails, we try HELO
            $this->server_send("HELO {$hostname}");
            if ($err_msg = $this->server_parse('250', __LINE__)) {
                return $this->numeric_response_code == 503 ? false : $err_msg;
            }
        }
        foreach ($this->responses as $response) {
            $response = explode(' ', $response);
            $response_code = $response[0];
            unset($response[0]);
            $this->commands[$response_code] = implode(' ', $response);
        }
    }