diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 9936858ef7..9b45e12dad 100644
a
|
b
|
if ( ! function_exists( 'wp_mail' ) ) : |
456 | 456 | // Set custom headers |
457 | 457 | if ( ! empty( $headers ) ) { |
458 | 458 | foreach ( (array) $headers as $name => $content ) { |
459 | | $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); |
460 | | } |
| 459 | // Only add custom header if not one that will be added automatically by wp-includes/class-phpmailer.php |
| 460 | if (('MIME-Version' !== $name) && ('X-Mailer' !== $name)) |
| 461 | $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); |
| 462 | } |