PHPMailer\PHPMailer

SMTP::connected()publicWP 1.0

Check connection state.

{} Это метод класса: SMTP{}

Хуков нет.

Возвращает

true|false. True if connected

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

$SMTP = new SMTP();
$SMTP->connected();

Код SMTP::connected() WP 5.9.3

public function connected()
{
    if (is_resource($this->smtp_conn)) {
        $sock_status = stream_get_meta_data($this->smtp_conn);
        if ($sock_status['eof']) {
            //The socket is valid but we are not connected
            $this->edebug(
                'SMTP NOTICE: EOF caught while checking if connected',
                self::DEBUG_CLIENT
            );
            $this->close();

            return false;
        }

        return true; //everything looks good
    }

    return false;
}