[wp-trac] [WordPress Trac] #15448: wp_mail() sets Content-Type header twice for multipart emails

WordPress Trac noreply at wordpress.org
Tue Jan 15 17:27:18 UTC 2013


#15448: wp_mail() sets Content-Type header twice for multipart emails
-------------------------------------------------+-------------------------
 Reporter:  rmccue                               |       Owner:  westi
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
Component:  Mail                                 |  Release
 Severity:  normal                               |     Version:
 Keywords:  gci has-patch 3.3-early westi-likes  |  Resolution:
-------------------------------------------------+-------------------------

Comment (by hydrurga):

 This is still a problem. Constructing one's own multipart/mixed email and
 sending it through wp_mail() results in attachments not being read
 properly by Hotmail's e-mail program (Gmail and RoundCube work fine). This
 is due to wp_mail() adding headers so that e.g. in totality, the following
 headers and body are produced:

 {{{
 MIME-Version: 1.0
 Content-Type: multipart/mixed;
 boundary="==Multipart_Boundary_x{82b884f3b88a46c15d210eda4b90a8f7}x"
 MIME-Version: 1.0
 Content-Transfer-Encoding: 8bit
 Content-Type: multipart/mixed; charset=""

 --==Multipart_Boundary_x{82b884f3b88a46c15d210eda4b90a8f7}x
 Content-Type: text/plain; charset="UTF-8"
 Content-Transfer-Encoding: 8bit

 Dear Recipient,
 ...
 }}}

 In this case, the lines

 {{{
 MIME-Version: 1.0
 Content-Transfer-Encoding: 8bit
 Content-Type: multipart/mixed; charset=""
 }}}

 are the ones added by wp_mail(), thus causing Hotmail to ignore any
 multiparts due to the second Content-Type definition overriding the first.

 Could we not just add a flag to wp_mail() that desists from adding any
 headers other than the ones supplied to it by the function call?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15448#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list