Title: Duplicate header field
Last modified: August 31, 2016

---

# Duplicate header field

 *  Resolved [wlperry95672](https://wordpress.org/support/users/wlperry95672/)
 * (@wlperry95672)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/)
 * BPS security sends nice emails letting me know when one of my sites is under 
   attack. Unfortunately, recently something is being mangled in the message and
   my mail server blocks it. I finally found the following message associated with
   one of the emails:
    INVALID HEADER Duplicate header field: “MIME-Version”
 * I think that I have finally found a way to check the mail source and I do in 
   fact see the following snippit of code:
 * X-Mailer: PHPMailer 5.2.14 ([https://github.com/PHPMailer/PHPMailer](https://github.com/PHPMailer/PHPMailer))
   
   MIME-Version: 1.0 MIME-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-
   Transfer-Encoding: quoted-printable
 * [https://wordpress.org/plugins/bulletproof-security/](https://wordpress.org/plugins/bulletproof-security/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322848)
 * I assume you are referring to the automated Security Log zip email? If so, the
   Mime header is only added once in the BPS code and uses wp_mail PHPMailer to 
   send the email.
 *     ```
       $attachments = array( $SecurityLogZip );
       $headers = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
       $headers .= "From: $bps_email_from" . "\r\n";
       $headers .= "Cc: $bps_email_cc" . "\r\n";
       $headers .= "Bcc: $bps_email_bcc" . "\r\n";
       $subject = " BPS Security Log - $timestamp ";
       $message = '<p><font color="blue"><strong>Security Log File For:</strong></font></p>';
       $message .= '<p>Site: '."$justUrl".'</p>';
       $message .= '<p><font color="blue"><strong>Total # of Security Log Entries by Type:</strong></font>'. $SecLogEntries .'</p>';
   
       $mailed = wp_mail($bps_email_to, $subject, $message, $headers, $attachments);
       ```
   
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322849)
 * I checked all other BPS code that sends mail and all of the code that does anything
   with mail headers is all ok with only 1 MIME-Version header.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322875)
 * I see the problem now and was able to confirm the duplicate headers problem. 
   This will be fixed in the next BPS version release. Thanks for letting us know
   about this.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322946)
 * If you want to fix this manually and modify the BPS code now then here is the
   new “headers” code below. We should have BPS .53.6 ready for release by next 
   Monday May 1st if you want to wait.
 * Replace the “headers” code:
 *     ```
       $headers = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
       $headers .= "From: $bps_email_from" . "\r\n";
       $headers .= "Cc: $bps_email_cc" . "\r\n";
       $headers .= "Bcc: $bps_email_bcc" . "\r\n";
       ```
   
 * With this new “headers” code:
 *     ```
       $headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . $bps_email_from, 'Cc: ' . $bps_email_cc, 'Bcc: ' . $bps_email_bcc );
       ```
   
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322997)
 * The new headers code has been added in BPS .53.6
 * Thread Start Date: 4-27-2016
    Thread Resolved/Current Date: 4-28-2016

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Duplicate header field’ is closed to new replies.

 * ![](https://ps.w.org/bulletproof-security/assets/icon-128x128.png?rev=1731938)
 * [BulletProof Security](https://wordpress.org/plugins/bulletproof-security/)
 * [Support Threads](https://wordpress.org/support/plugin/bulletproof-security/)
 * [Active Topics](https://wordpress.org/support/plugin/bulletproof-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bulletproof-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bulletproof-security/reviews/)

## Tags

 * [email](https://wordpress.org/support/topic-tag/email/)

 * 5 replies
 * 2 participants
 * Last reply from: [AITpro](https://wordpress.org/support/users/aitpro/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/duplicate-header-field/#post-7322997)
 * Status: resolved