Title: Duplicate Mime Version Headers
Last modified: March 2, 2019

---

# Duplicate Mime Version Headers

 *  Resolved [ollybach](https://wordpress.org/support/users/ollybach/)
 * (@ollybach)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/)
 * It seems the plugin indiscriminately sets a second mime version header even if
   it already exists. for many servers this might be fine, but for some it is not
   and then throw errors like so
    `SMTP Error: data not accepted.SMTP server error:
   DATA END command failed Detail: Transaction failed: Duplicate header 'MIME-Version'.`
 * i.e, i simply (programatically) send the following email – the variables are 
   of course replaced with whats appropriate – a second Mime-Version header gets
   added by WP Mail SMTP
 *     ```
       $headers   = array();
       $headers['mime'] 	= "MIME-Version: 1.0";
       $headers['content'] = "Content-type: ".$mail_message['type']."; charset=".$mail_message['charset']."";
       $headers['from'] 	= "From: ".$from_name." <".$from_address.">";
       $headers['mailer'] 	= "X-Mailer: PHP/".phpversion();
       /* implode */
       $headers   			= implode("\r\n", $headers);
   
       /*
       	send the email
       */
       $sending_mail = wp_mail($recipient, $subject, $message, $headers);
       ```
   
 * any advise ?

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

 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11276580)
 * Hi
 * Could you please provide a complete original email with all of its headers (including
   doubled `MIME-Version`)?
 *  Thread Starter [ollybach](https://wordpress.org/support/users/ollybach/)
 * (@ollybach)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11276872)
 * there you go (i’ve removed/changed real email addresses/domain/ipaddresses for
   dummy ones though)
 *     ```
       From - Tue Mar  5 14:13:17 2019
       X-Account-Key: account1
       X-UIDL: UID46479-1442527387
       X-Mozilla-Status: 0001
       X-Mozilla-Status2: 00000000
       X-Mozilla-Keys:                                                                                 
       Return-Path: <mail@domain.com>
       Delivered-To: my-mail@domain.com
       Received: from dns.domain.com
       	by dns.domain.com with LMTP
       	id XXXXXXXXXXXXXXXXXX/7Q
       	(envelope-from <mail@domain.com>)
       	for <my-mail@domain.com>; Tue, 05 Mar 2019 14:12:16 +0000
       Return-path: <mail@domain.com>
       Envelope-to: my-mail@domain.com
       Delivery-date: Tue, 05 Mar 2019 14:12:16 +0000
       Received: from 00-000-00-00.xxx.xxxxx.xxxxx.xx ([00.000.00.00]:59584 helo=www.domain.com)
       	by dns.domain.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
       	(Exim 4.91)
       	(envelope-from <mail@domain.com>)
       	id 1h1Ann-000000-UJ
       	for my-mail@domain.com; Tue, 05 Mar 2019 14:12:16 +0000
       Date: Tue, 5 Mar 2019 14:12:16 +0000
       To: my-mail@domain.com
       From: test <mail@domain.com>
       Subject:  some subject line.
       Message-ID: <xxxxxxxxxxxxxxxxxxxxxxx@www.domain.com>
       X-Mailer: WPMailSMTP/Mailer/smtp 1.4.1
       MIME-Version: 1.0
       X-Mailer: PHP/7.3.1
       MIME-Version: 1.0
       Content-Type: text/plain; charset=UTF-8
       Content-Transfer-Encoding: 8bit
   
       some plaintext content here
       ```
   
 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11281303)
 * Do all emails have a similar header? Including the test email that you can send
   on “Email Test” tab in the plugin admin area?
 *  Thread Starter [ollybach](https://wordpress.org/support/users/ollybach/)
 * (@ollybach)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11281671)
 * In fact – after a bit more digging around my end – this does not actually seem
   to be caused by WP Mail SMTP after all (what i was referring to are emails that
   are being sent in a loop by wp_cron)
 * Not sure yet why this happens as I have used wp_mail many times before without
   ever having this issue.
    So, let’s consider this resolved I would say (I can 
   always get back to you if it turns out there’s some strange interaction going
   on between things)
 * Thanks for the support nevertheless (your suggestions also helped me to narrow
   things down somewhat) . Sorry for wasting your time
 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11282720)
 * [@ollybach](https://wordpress.org/support/users/ollybach/)
 * Yeah, I was wondering too how the plugin can cause that as it just converts all
   the headers and adds only 1 (`X-Mailer`).
    It’s not wasting, it’s investigation
   🙂
 * Get back to me if you understand the issue or WP Mail SMTP is in charge of that.
 * Thanks!
 *  Thread Starter [ollybach](https://wordpress.org/support/users/ollybach/)
 * (@ollybach)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11282780)
 * cheers,
 * FYI:
    as it turns out is is the Worderpress phpmailer class that adds the additional`
   MIME-Version: 1.0` to the emails , regardless of whether it was set already. 
   It also *appears* (not checked for all eventualities though) that this only happens
   when using `wp_cron` to send these mails and only if using `wp_mail`.
 * if i use `mail` instead, this does not happen (or one would think if using `wp_mail`
   but not setting that Mime header in the first place as phpmailer adds it anyway)
 * there are in fact also some google results regarding WP and duplicate mime-version
   headers, though nothing that specifically refers to wp_cron as such, but I have
   not extensively read through all those trac tickets either admittedly as I found
   a solution for my specific scenario, but maybe the above info will help someone
   one day
 * again, thanks for your time

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

The topic ‘Duplicate Mime Version Headers’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [ollybach](https://wordpress.org/support/users/ollybach/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/duplicate-mime-version-headers/#post-11282780)
 * Status: resolved