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

PHPMailer\PHPMailer

PHPMailer::mailSend() protected WP 1.0

Send mail using the PHP mail() function.

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

Хуков нет.

Возвращает

true/false.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->mailSend( $header, $body );
$header(строка) (обязательный)
The message headers
$body(строка) (обязательный)
The message body

Заметки

Код PHPMailer::mailSend() WP 5.5.1

<?php
protected function mailSend($header, $body)
{
    $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;

    $toArr = [];
    foreach ($this->to as $toaddr) {
        $toArr[] = $this->addrFormat($toaddr);
    }
    $to = implode(', ', $toArr);

    $params = null;
    //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
    //A space after `-f` is optional, but there is a long history of its presence
    //causing problems, so we don't use one
    //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
    //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html
    //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html
    //Example problem: https://www.drupal.org/node/1057954
    // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
    if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) {
        $params = sprintf('-f%s', $this->Sender);
    }
    if (!empty($this->Sender) && static::validateAddress($this->Sender)) {
        $old_from = ini_get('sendmail_from');
        ini_set('sendmail_from', $this->Sender);
    }
    $result = false;
    if ($this->SingleTo && count($toArr) > 1) {
        foreach ($toArr as $toAddr) {
            $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
            $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
        }
    } else {
        $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
        $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
    }
    if (isset($old_from)) {
        ini_set('sendmail_from', $old_from);
    }
    if (!$result) {
        throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL);
    }

    return true;
}