Content-Type header not being set
-
I believe there is a bug in
wp-mail-api.php
line 381. The Content-Type header will never be set because it’s removed from the$headers
array earlier on and theisset($headers['Content-Type'])
check will always return false.// Set the content-type and charset $charset = apply_filters('wp_mail_charset', $charset); if (isset($headers['Content-Type'])) { if (!strstr($headers['Content-Type'], 'charset')) { $headers['Content-Type'] = rtrim($headers['Content-Type'], '; ') . "; charset={$charset}"; } }
I’m trying to set the content type to
text/html; charset=UTF-8
but the email is being delivered withtext/html; charset=ascii
– I presume Mailgun server is automatically adding the header but with the wrong charset.
- The topic ‘Content-Type header not being set’ is closed to new replies.