diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 9936858ef7..1360f9849d 100644
a
|
b
|
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() |
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 ) ); |
| 459 | // Only add a custom header if the header is not automagically added from |
| 460 | // /wp-includes/class-phpmailer.php |
| 461 | if ( 'MIME-Type' !== $name && 'X-Mailer' !== $name && empty( get_header( $name ) ) ) { |
| 462 | $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); |
| 463 | } |
460 | 464 | } |
461 | 465 | |
462 | 466 | if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) { |