diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 9336e03c7e..835a0d6df3 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -450,10 +450,13 @@ if ( ! function_exists( 'wp_mail' ) ) : */ $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); - // Set custom headers + // Set custom headers. if ( ! empty( $headers ) ) { foreach ( (array) $headers as $name => $content ) { - $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); + // Only add custom headers not added automatically by PHPMailer. + if ( ! in_array( $name, array( 'MIME-Version', 'X-Mailer') ) ) { + $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); + } } if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 8f4f2f8df3..a000f98723 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46114'; +$wp_version = '5.3-alpha-46115'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.