Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#39775 new defect (bug)

wp_mail miss send Content-Type with boundary when array header does not have other custom headers

Reported by: kn007's profile kn007 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:


It's a PR send in github.

Fix empty charset in line 436.
Content-Type: multipart/alternative; charset=
Content-Type: multipart/alternative; charset=UTF-8

fix $headers[] = "Content-Type: multipart/alternative; boundary=\"$boundary\""; not send when not other headers.

Test Code:

$boundary = md5( uniqid() . microtime() );
$to = '';
$subject = 'TEST';
$headers[] = "From: Wordpress <>";
$headers[] = "Content-Type: multipart/alternative; boundary=\"$boundary\"";
$body  = "--$boundary\r\n" .
         "Content-Type: text/plain; charset=UTF-8\r\n";
$body .= 'test';
$body .= "--$boundary\r\n" .
         "Content-Type: text/html; charset=UTF-8\r\n";
$body .= '<div>test</div>';
wp_mail( $to, $subject, $body, $headers );



I could search some issue for this, like

but still have same problem here.

Change History (1)

#1 @swissspidy
7 years ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.