Chinese Characters in email sent via PHP not showing up

请求翻译

I send mail via PHP with Chinese characters from my testing server, and it sends it out perfectly. The encoding is UTF-8. When I upload the same PHP file to another server and try to send e-mail from there, it will look 90% fine in one mail client (web-based mail actually, GMail), but in another mail client (Apple Mail) it's all gibberish - even when I try changing the encoding in the mail client.

I'm stuck here, because everything works fine on one server but not another. I'm not sure where to start looking for solutions. What's even more puzzling is that on the production server, the e-mail looks somewhat ok (strange case of some characters not showing), but in other mail apps it looks like garbage.

Any idea where I can start looking to solve this?

PHP

$books = json_decode ($_POST['books']);

$body = '
你好 ' . $_POST['name'] . ',

以下是你从学习网站,给孩子讲故事课程,所要求的书籍名单


'; $iLen = count($books); for ($i = 0; $i < $iLen; $i = $i + 1) { $book = $books[$i]; $body .= '' . $book->title . '
' . $book->author . '

'; $body .= '简介: ' . $book->synopsis . '
'; $body .= '年龄层: ' . $book->age . '
'; $body .= '场景: ' . $book->setting . '
'; $body .= '目的: ' . $book->purpose . '
'; $body .= '索书号: ' . $book->call . '

'; $body .= '出版商: ' . $book->publisher . '


'; } $body .= '
亲切问侯,
Name
'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $headers .= 'From: Name ' . "\r\n"; $ok = mail ($_POST['email'], '讲故事给孩子听:您所要求的故事精选书单', $body, $headers);

Result

?∏ ?¥∏ ryan,

??¥??—??ˉ?∏ ????–??’ ?∏???˙,??˙?–??–?è?”??∑?o—èˉ≤?¨—,?≈?è???±≠??≥?’??±???????

?‘??‘??√???≈?¤??√±?∏ 
éo??∑—??∞é?·?°π, ?±±?§∫ 

Synopsis: ??—??ˉ?√±??≥?°??∑‰??ˇ??ˇ????’√?‰¨??∞?—??≈’??≥??’?π???‘?∑‰??√??√èˉ′??∞??≈?¤??√±??∞??≠
Age Group: 4 - 6 ?”?
Setting: ?≤¤?∏?
Purpose: ??·??πè§≠??‘??∞è???o”?–???≥?≥??∞∑
Call no: JP MAC

Publisher: éo??∑—??∞é?·?°π, ?±±?§∫. ?‘??‘??√???≈?¤??√±?∏ .??…?μ· : ?°??’′?≥???¥?Ωo?≈√?¤≤, 2005.

3个回答