Use this charset
:
$mailHeader2 .= "Mime-Version: 1.0 \r\n";
$mailHeader2 .= "Content-Type: text/html; charset=utf-8";
Use this charset
:
$mailHeader2 .= "Mime-Version: 1.0 \r\n";
$mailHeader2 .= "Content-Type: text/html; charset=utf-8";
Imagining that your problem is related to characters with accents and eñes, it is very likely that you should use the UTF-8 charset.
Using the information in this answer , this would be the code of your header:
$mailHeader2 .= "Content-Type: text/html; charset=utf-8";
And if the content of your email does not have any HTML, then you can use this header:
$mailHeader2 .= "Content-Type: text/plain;charset=utf-8";
Also, make sure that the charset of your PHP file is the same as the one you are placing in the header. That is, if you are going to send the email in UTF-8, your PHP file must also be written in UTF-8.
charset=utf-8
, since it contains all the characters of the Spanish language.