PHPMailer\PHPMailer

PHPMailer::setError()protectedWP 1.0

Add an error message to the error container.

Метод класса: PHPMailer{}

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->setError( $msg );
$msg(строка) (обязательный)
-

Код PHPMailer::setError() WP 6.5.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;
}