WordPress at a glance
function is not described

PHPMailer\PHPMailer

SMTP::startTLS() public WP 1.0

Initiate a TLS (encrypted) session.

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

No Hooks.

Return

true|false.

Usage

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

Code of SMTP::startTLS() WP 5.7.2

<?php
public function startTLS()
{
    if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
        return false;
    }

    //Allow the best TLS version(s) we can
    $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;

    //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
    //so add them back in manually if we can
    if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
        $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
        $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
    }

    //Begin encrypted connection
    set_error_handler([$this, 'errorHandler']);
    $crypto_ok = stream_socket_enable_crypto(
        $this->smtp_conn,
        true,
        $crypto_method
    );
    restore_error_handler();

    return (bool) $crypto_ok;
}