hi All,
a funny problem. I send mail via PHP from my testing server with Chinese chars in it and it sends perfectly. Encoding is utf-8. When I upload the same PHP file to another server and try to send from there, the e-mail will look 90% fine in one mail client (web-based mail actually, gmail), but in my 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 on another so I'm not sure where to start looking for solutions. What's even more puzzling is that on the production server, the 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?
thanks for any help here!
Regards..
php script
$books = json_decode ($_POST['books']);
$body = '
你好 ' . $_POST['name'] . ',以下是你从学习网站,给孩子讲故事课程,所要求的书籍名单
'; $iLen = count($books); for ($i = 0; $i ' . $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,
ä»¥ä¸—æ˘¯ä∏ ä»⁄å–œä’ ç∏Œç«˙,ç»˙å–©å–∆è®”æ∑亗è¯≤稗,æ≈•èœ™æ±≠ç˚≥䒜籟å∆ŸåŸ
瑲瑲æ√Œæ˛≈å¤˚ç√±ä∏ 麜å∑—å¸∞é˝·å°π, å±±å§∫
Synopsis: 粗å∂¯ç√±ç˚≥å°∂å∑‰å®ˇå®ˇæ•⁄ä’√牨å®∞ç—¬ç≈’ç˚≥戒åπ∂å‚‘å∑‰åœ√åœ√说å®∞æ˛≈å¤˚ç√±å®∞ã•≠ Age Group: 4 - 6 å”™ Setting: ç≤¤ä∏„ Purpose: ä»·å•πè§≠å‚‘ä¿∞è¿˝äº”å–∆ç˚≥æ≥ƒæ∞∑ Call no: JP MAC
Publisher: 麜å∑—å¸∞é˝·å°π, å±±å§∫. 瑲瑲æ√Œæ˛≈å¤˚ç√±ä∏ .丅海 : 尌咴å≥¿ç«¥åΩºç≈√ç¤≤, 2005.