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

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 12 07:37:35 UTC 2010


#15448: wp_mail() sets Content-Type header twice for multipart emails
-------------------------+--------------------------------------------------
 Reporter:  rmccue       |       Owner:  rmccue         
     Type:  enhancement  |      Status:  assigned       
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------

Comment(by rmccue):

 Turns out you *can't* have custom headers with PHPMailer anyway.

 The patch I've included allows you to use an array such as the one I
 mentioned above. What I'd like to do is have the ability to add inline
 attachments (e.g. images), but I'm not sure how one would achieve that.
 With images, you're likely to have more than one, and if they're the same
 type, you're slightly screwed.

 Perhaps allowing the following would be better:
 {{{
 $message = array(
         'text/plain' => 'xyz',
         'text/html' => '<b>xyz</b>',
         'image/png' => array(
                 'file1.png',
                 'file2.png'
         )
 );
 }}}

 But we still then have the issue of working of if it's inline or an
 attachment. We might be able to do this based on the type, but I'm
 thinking a filter would work well for it. I'll submit a patch to that
 effect later.

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


More information about the wp-trac mailing list