Strange characters in message subject, using wp_mail

Asked

Viewed 45 times

1

Good evening, I would like someone to help me in this, I developed wordpress plugin, sends emails perfectly, but when subject contains accent, the subject is displayed strangely, see...

The subject comes this way... =??Q?= C3=89_somente_um_test.?=

Does anyone have any idea what it is? This is the code I’m using to send emails...

/// to
$to = $args['send_to'];
/// message
$that_message = self::preg_parse($msg['mp_message'], $args);
/// subject
$subject = "É somente um teste.";
/// headers
$headers = array('Content-type: text/html;');

wp_mail($to, $subject, $that_message, $headers);

1 answer

1


You can pass the charset, saying what kind of encoding your HTML, since you enabled it by your headers in this way:

$headers = array('Content-Type: text/html; charset=UTF-8');
  • Thanks for replying @Michel Simões worked perfectly...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.