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

PHPMailer\PHPMailer

PHPMailer::sendmailSend() protected WP 1.0

Send mail using the $Sendmail program.

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

Хуков нет.

Возвращает

true/false.

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

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

Заметки

  • Смотрите: PHPMailer::$Sendmail

Код PHPMailer::sendmailSend() WP 5.5.1

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

    // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
    if (!empty($this->Sender) && self::isShellSafe($this->Sender)) {
        if ('qmail' === $this->Mailer) {
            $sendmailFmt = '%s -f%s';
        } else {
            $sendmailFmt = '%s -oi -f%s -t';
        }
    } elseif ('qmail' === $this->Mailer) {
        $sendmailFmt = '%s';
    } else {
        $sendmailFmt = '%s -oi -t';
    }

    $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);

    if ($this->SingleTo) {
        foreach ($this->SingleToArray as $toAddr) {
            $mail = @popen($sendmail, 'w');
            if (!$mail) {
                throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
            }
            fwrite($mail, 'To: ' . $toAddr . "\n");
            fwrite($mail, $header);
            fwrite($mail, $body);
            $result = pclose($mail);
            $this->doCallback(
                ($result === 0),
                [$toAddr],
                $this->cc,
                $this->bcc,
                $this->Subject,
                $body,
                $this->From,
                []
            );
            if (0 !== $result) {
                throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
            }
        }
    } else {
        $mail = @popen($sendmail, 'w');
        if (!$mail) {
            throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
        }
        fwrite($mail, $header);
        fwrite($mail, $body);
        $result = pclose($mail);
        $this->doCallback(
            ($result === 0),
            $this->to,
            $this->cc,
            $this->bcc,
            $this->Subject,
            $body,
            $this->From,
            []
        );
        if (0 !== $result) {
            throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
        }
    }

    return true;
}