我有以下脚本:
<?php
$subject = "Testmail — Special Characters";
$msg = "Hi there,\n\nthis isn’t something easy.\n\nI haven’t thought that it’s that complicated!";
mail($to,$subject,$msg,$from."\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n");
?>
在电子邮件中:
主题:Testmail ? Special Characters
Body:
Hi there,
this isn?t something easy.
I haven?t thought that it?s that complicated!
我尝试了很多事情,但我已经没有想法了。
你能帮助我吗?你有这个工作吗?
THX!
你试过了吗iconv_set_encoding http://php.net/manual/en/function.iconv-set-encoding.php ?
这应该有效:
<?php
iconv_set_encoding("internal_encoding", "UTF-8");
$subject = "Testmail — Special Characters";
$msg = "Hi there,\n\nthis isn’t something easy.\n\nI haven’t thought that it’s that complicated!";
mail(utf8_decode($to), utf8_decode($subject), utf8_decode($msg), utf8_decode($from)."\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n");?>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)