[wp-hackers] Customize Wordpress Emails

Ryan McCue lists at rotorised.com
Sat Dec 11 02:42:10 UTC 2010

William Davis wrote:
> I've sent HTML e-mail using wp_mailer():
> $headers = "From: Me, yo\r\n";
> $headers .= 'MIME-Version: 1.0' . "\r\n";
> $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
> wp_mail($email, $subject, $body, $headers)

If you want to send multipart emails, you're essentially screwed though.
phpmailer will add an extra Content-Type header (Content-Type:
multipart/alternative; charset=""), which will override your original
Content-Type with the boundary. This will still work in Thunderbird, but
Outlook will fail to see the boundary and spew your entire body out
(including boundaries) as text.

I'm working on this on #15448, but be aware of it if you're trying to
send multipart emails through wp_mail()

Ryan McCue

More information about the wp-hackers mailing list