When you use the Mail method to send a letter, if the title or sender contains Chinese, it will cause garbled text, and the body will not. The solution is as follows
First Use the function Base64_encode ()? Using MIME base64 to encode data
The header string is encoded before the type example: =? UTF-8? B?
After the title string is added:? =
Mail header description Content-type? Prevent message body also garbled
First join the statement in the message header
If your site is GBK, the following utf-8 will be changed to GBK
$headers = ' mime-version:1.0 '. "\ r \ n";
$headers. = ' content-type:text/html; Charset=utf-8 '. "\ r \ n";
And then transfer the Chinese language where you need to use Chinese.
If your site is GBK, the following utf-8 will be changed to gb2312
such as title
$subject = "New password notification letter";
$subject = "=? UTF-8? B? ". Base64_encode ($subject). "? =";
such as sender
$headers. = ' From: =? UTF-8? B? '. Base64_encode ("XXX website"). ' =<service@apieye.com> '. "\ r \ n";