WordPress at a glance
function is not described

PHPMailer\PHPMailer

PHPMailer::setError() protected WP 1.0

Add an error message to the error container.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->setError( $msg );
$msg(string) (required)
-

Code of PHPMailer::setError() WP 5.7.2

<?php
protected function setError($msg)
{
    ++$this->error_count;
    if ('smtp' === $this->Mailer && null !== $this->smtp) {
        $lasterror = $this->smtp->getError();
        if (!empty($lasterror['error'])) {
            $msg .= $this->lang('smtp_error') . $lasterror['error'];
            if (!empty($lasterror['detail'])) {
                $msg .= ' Detail: ' . $lasterror['detail'];
            }
            if (!empty($lasterror['smtp_code'])) {
                $msg .= ' SMTP code: ' . $lasterror['smtp_code'];
            }
            if (!empty($lasterror['smtp_code_ex'])) {
                $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
            }
        }
    }
    $this->ErrorInfo = $msg;
}