WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

PHPMailer\PHPMailer

PHPMailer::createHeader() public WP 1.0

Assemble message headers.

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

Хуков нет.

Возвращает

Строку. The assembled headers

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

$PHPMailer = new PHPMailer();
$PHPMailer->createHeader();

Код PHPMailer::createHeader() WP 5.5.1

<?php
public function createHeader()
{
    $result = '';

    $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate);

    // To be created automatically by mail()
    if ($this->SingleTo) {
        if ('mail' !== $this->Mailer) {
            foreach ($this->to as $toaddr) {
                $this->SingleToArray[] = $this->addrFormat($toaddr);
            }
        }
    } elseif (count($this->to) > 0) {
        if ('mail' !== $this->Mailer) {
            $result .= $this->addrAppend('To', $this->to);
        }
    } elseif (count($this->cc) === 0) {
        $result .= $this->headerLine('To', 'undisclosed-recipients:;');
    }

    $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]);

    // sendmail and mail() extract Cc from the header before sending
    if (count($this->cc) > 0) {
        $result .= $this->addrAppend('Cc', $this->cc);
    }

    // sendmail and mail() extract Bcc from the header before sending
    if ((
            'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer
        )
        && count($this->bcc) > 0
    ) {
        $result .= $this->addrAppend('Bcc', $this->bcc);
    }

    if (count($this->ReplyTo) > 0) {
        $result .= $this->addrAppend('Reply-To', $this->ReplyTo);
    }

    // mail() sets the subject itself
    if ('mail' !== $this->Mailer) {
        $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
    }

    // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
    // https://tools.ietf.org/html/rfc5322#section-3.6.4
    if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) {
        $this->lastMessageID = $this->MessageID;
    } else {
        $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
    }
    $result .= $this->headerLine('Message-ID', $this->lastMessageID);
    if (null !== $this->Priority) {
        $result .= $this->headerLine('X-Priority', $this->Priority);
    }
    if ('' === $this->XMailer) {
        $result .= $this->headerLine(
            'X-Mailer',
            'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)'
        );
    } else {
        $myXmailer = trim($this->XMailer);
        if ($myXmailer) {
            $result .= $this->headerLine('X-Mailer', $myXmailer);
        }
    }

    if ('' !== $this->ConfirmReadingTo) {
        $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
    }

    // Add custom headers
    foreach ($this->CustomHeader as $header) {
        $result .= $this->headerLine(
            trim($header[0]),
            $this->encodeHeader(trim($header[1]))
        );
    }
    if (!$this->sign_key_file) {
        $result .= $this->headerLine('MIME-Version', '1.0');
        $result .= $this->getMailMIME();
    }

    return $result;
}