I am using the wp_mail() to send emails from a custom WordPress plugin.
I am trying to figure out why the emails sent result in some non-alphanumeric characters in the email subject being changed? For example, a subject such as "Word1 - Word2" will be received as "Word1 – Word 2", which doesn't look good at all.
The code looks like this:
$subject = 'word1 - word2';
$msg = 'message';
$headers = 'Content-Type: text/html; charset=utf-8';
wp_mail('a@b.com', $subject, $msg, $headers);
The email subject shows "Word1 – Word 2" in Gmail. I know it has to do with encoding, but does anyone know how to fix this?
Thanks!