diff --git a/wp-db-backup.php b/wp-db-backup.php index eb23d0b..6e0d94a 100755 --- a/wp-db-backup.php +++ b/wp-db-backup.php @@ -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' ) ) @@ -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();