PHPMailer\PHPMailer

PHPMailer::postSend()publicWP 1.0

Actually send a message via the selected mechanism.

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

Хуков нет.

Возвращает

true|false.

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

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

Код PHPMailer::postSend() WP 6.6.2

public function postSend()
{
    try {
        //Choose the mailer and send through it
        switch ($this->Mailer) {
            case 'sendmail':
            case 'qmail':
                return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
            case 'smtp':
                return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
            case 'mail':
                return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
            default:
                $sendMethod = $this->Mailer . 'Send';
                if (method_exists($this, $sendMethod)) {
                    return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody);
                }

                return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
        }
    } catch (Exception $exc) {
        $this->setError($exc->getMessage());
        $this->edebug($exc->getMessage());
        if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) {
            $this->smtp->reset();
        }
        if ($this->exceptions) {
            throw $exc;
        }
    }

    return false;
}