PHPMailer\PHPMailer

PHPMailer::setError()protectedWP 1.0

Add an error message to the error container.

Method of the class: PHPMailer{}

No Hooks.

Return

null. Nothing (null).

Usage

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

PHPMailer::setError() code WP 6.6.2

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 .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
            }
            if (!empty($lasterror['smtp_code'])) {
                $msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code'];
            }
            if (!empty($lasterror['smtp_code_ex'])) {
                $msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex'];
            }
        }
    }
    $this->ErrorInfo = $msg;
}