WordPress at a glance
function is not described

PHPMailer\PHPMailer

SMTP::connected() public WP 1.0

Check connection state.

{} It's a method of the class: SMTP{}

No Hooks.

Return

true|false. True if connected

Usage

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

Code of SMTP::connected() WP 5.7.2

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