I have problem with emails in Wordpress. I have to send message with Content-Type is text/plain, but in Wordpress default Content-Type is text/html. That change chars like &
to &
.
How can I change Content-Type? Please help.
I have problem with emails in Wordpress. I have to send message with Content-Type is text/plain, but in Wordpress default Content-Type is text/html. That change chars like &
to &
.
How can I change Content-Type? Please help.
You didn't say how you're sending emails, but if you're using wp_mail
, this is how you change the type to text/plain
:
function wp_set_mail_plaintext() {
return 'text/plain';
}
add_filter( 'wp_mail_content_type', 'wp_set_mail_plaintext' );