Joh*_*ith 4 php email special-characters
我有以下脚本:
<?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");
?>
Run Code Online (Sandbox Code Playgroud)
在电子邮件中:
学科: Testmail ? Special Characters
身体:
Hi there,
this isn?t something easy.
I haven?t thought that it?s that complicated!
Run Code Online (Sandbox Code Playgroud)
我尝试了很多东西,但我已经没有想法了.你能帮助我吗?你有没有这个工作?
谢谢!
Gre*_*rus 12
你尝试过iconv_set_encoding吗?
这应该工作:
<?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");?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19662 次 |
| 最近记录: |