diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 7b13c91..e38a5de 100644
|
a
|
b
|
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { |
| 390 | 390 | global $phpmailer; |
| 391 | 391 | |
| 392 | | // (Re)create it, if it's gone missing or been destroyed |
| 393 | | if ( ! ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) ) { |
| 394 | | require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php'; |
| 395 | | require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php'; |
| 396 | | require_once ABSPATH . WPINC . '/PHPMailer/Exception.php'; |
| 397 | | |
| 398 | | $phpmailer = new PHPMailer\PHPMailer\PHPMailer( true ); |
| 399 | | } |
| | 392 | /* |
| | 393 | * Always create a new PHPMailer instance to ensure that no residual state |
| | 394 | * such as Encoding, attachments, or headers persist between wp_mail() calls. |
| | 395 | * This fixes stale configuration issues introduced by static use of $phpmailer. |
| | 396 | */ |
| | 397 | |
| | 398 | require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php'; |
| | 399 | require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php'; |
| | 400 | require_once ABSPATH . WPINC . '/PHPMailer/Exception.php'; |
| | 401 | |
| | 402 | $phpmailer = new PHPMailer\PHPMailer\PHPMailer( true ); |
| | 403 | |
| | 404 | // Ensure Encoding resets to default (8bit) |
| | 405 | $phpmailer->Encoding = '8bit'; |
| 400 | 406 | |