Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion wp-db-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,9 @@ function send_mail( $to, $subject, $message, $diskfile) {
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message' ) ) );

if ( !is_object( $phpmailer ) || ( strtolower(get_class( $phpmailer )) != 'phpmailer' ) ) {
// WordPress 5.5: PHPMailer moved from class-phpmail.php to PHPMailer/PHPMailer.php
if ( file_exists( ABSPATH . WPINC . '/PHPMailer/PHPMailer.php' ) )
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
if ( file_exists( ABSPATH . WPINC . '/class-phpmailer.php' ) )
require_once ABSPATH . WPINC . '/class-phpmailer.php';
if ( file_exists( ABSPATH . WPINC . '/class-smtp.php' ) )
Expand All @@ -960,7 +963,12 @@ function send_mail( $to, $subject, $message, $diskfile) {
}

// try to use phpmailer directly (WP 2.2+)
if ( is_object( $phpmailer ) && ( strtolower(get_class( $phpmailer )) == 'phpmailer' ) ) {
if ( is_object( $phpmailer ) &&
(
( strtolower(get_class( $phpmailer )) == 'phpmailer' )
|| ( strtolower(get_class( $phpmailer )) == 'phpmailer\phpmailer\phpmailer' )
)
) {

// Get the site domain and get rid of www.
$sitename = $this->get_sitename();
Expand Down