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

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 14 10:02:24 UTC 2010


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

Comment(by westi):

 Replying to [comment:6 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.

 This is looking good.

 I just checked the "Unit" Tests we have and found that we do have some for
 the wp_mail function :-)

 Would be good to add some more test cases for your new functionality if
 you get time but you should at least check that the current ones pass :-D

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


More information about the wp-trac mailing list