title: PHPmailer Content-Type: multipart/alternative
body: <p>I'm having problem sending multi part email with wp_mail() and PHPMailer in WordPress.</p>
  
  <p>This mail header:</p>
  
  <pre><code>    $wp_mail_headers = array(
          "From: Test &lt;test@test.com&gt;",
          'Content-Type: multipart/alternative;
  boundary="b_00cdedc7a5309e22d6d51e1ad7ad886e"',
      );
  </code></pre>
  
  <p>will look like this when sending with PHPMailer, the boundary is gone:</p>
  
  <pre><code>X-Mailer: PHPMailer 5.2.22 (https://github.com/PHPMailer/PHPMailer)
  MIME-Version: 1.0
  Content-Type: multipart/alternative; charset=
  Content-Transfer-Encoding: quoted-printable
  </code></pre>
  
  <p>Should look like this:</p>
  
  <pre><code>MIME-Version: 1.0    
  Content-Type: multipart/alternative; boundary="b_00cdedc7a5309e22d6d51e1ad7ad886e"
  </code></pre>
  
  <p>How to set up multi part email header with PHPMailer?</p>
  
  <p>Thanks!</p>
  
  <p>Update:</p>
  
  <p>How about adding filter? Will that work? For example:</p>
  
  <pre><code>add_filter( 'wp_mail', 'rw_change_email_headers' );
  function rw_change_email_headers( $params )
  {
      $params['headers'] = 'Content-type: text/html';
      return $params;
  }
  </code></pre>
  
  <p>If filter works with PHPMailer how to add it to below code?
  And should the filter be removed afterwards with remove_filter( )?</p>
  
  <pre><code>$wp_mail_headers = array(
      "From: Test &lt;$wp_admin_email&gt;",
      "Bcc: test@test.com",
      "Reply-To: $wp_admin_email",
      'Content-Type: multipart/alternative; boundary="b_00cdedc7a5309e22d6d51e1ad7ad886e"',
  );
  
  $wp_mail_message = '--b_00cdedc7a5309e22d6d51e1ad7ad886e
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable';
  
  $wp_mail_message .= get_field('order_email_plain_text', 'option');
  
  $wp_mail_message .= '--b_00cdedc7a5309e22d6d51e1ad7ad886e
  Content-Type: text/html; charset="UTF-8"
  Content-Transfer-Encoding: quoted-printable
  
  &lt;!doctype html&gt;&lt;html lang="en"&gt;&lt;head&gt;&lt;meta name="viewport" content="width=device-width" /&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;&lt;title&gt;Order Email&lt;/title&gt;&lt;/head&gt;&lt;body&gt;';
  $wp_mail_message .= get_field('order_email', 'option');
  $wp_mail_message .= '&lt;/body&gt;&lt;/html&gt;
  --b_00cdedc7a5309e22d6d51e1ad7ad886e--';
  </code></pre>