
I have only noticed this problem since Wordpress 4.6+. The question is: why is setting the multipart boundary dependent on there being these so called 'custom headers'? Hence, if $headers is empty, as is the case for my example above, the multipart boundary is not set. Strangely, not only does this if statement block set the 'custom headers' ($headers) when they exist, it also sets the Content-Type: multipart/. $phpmailer->AddCustomHeader( sprintf( ""Content-Type: %s \n\t boundary=\""%s\"""", $content_type, $boundary ) ) If ( false != stripos( $content_type, 'multipart' ) & ! empty($boundary) )

$phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ) At the end of processing $tempheaders, if there are no 'custom header' fields present, then the $headers variable remains an empty array.Īt line 441, the $headers variable is tested to see if any 'custom headers' need setting. Any other header fields are considered 'custom headers' and are added back into the $headers array by the default case of the switch block.

$tempheaders is then processed in a switch statement block starting at line 251 to extract the header fields From, Content_Type, Cc, Bcc and Reply-To. The function argument $headers array/string supplied by the user is assigned to a variable $tempheaders and then $headers is set to an empty array. The source of the problem is in the Wordpress file /includes/pluggable.php, function wp_mail(). I use Thunderbird and it shows no content at all.
#Hearts of iron 3 not working for mac 2018 couldn't prepare fs register code
The email sent by this code should show either the text part or the html part, depending on the email client.
Wp_mail( 'Multipart email test', $body, $headers )
