Php 使用mail()发送UTF8电子邮件

Php 使用mail()发送UTF8电子邮件,php,email,utf-8,Php,Email,Utf 8,我正在尝试用PHP发送电子邮件,包括多语言字符。整个站点(html头、php头)以及表单字符集都设置为UTF8 我现在拥有的PHP代码是: $to = "email@email.com"; $subject = "Subject"; $message = "Question is ".$question; $from = "auto@from.com"; $headers = "From:" . $from . "\r\n"; $headers .= 'Content-type: text/ht

我正在尝试用PHP发送电子邮件,包括多语言字符。整个站点(html头、php头)以及表单字符集都设置为UTF8

我现在拥有的PHP代码是:

$to = "email@email.com";
$subject = "Subject";
$message = "Question is ".$question;
$from = "auto@from.com";
$headers = "From:" . $from . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-UTF-8' . "\r\n";

$sendmail = @mail($to,$subject,$message,$headers);
我想我在什么地方错了

例如,我得到了带有日语字母的“?”字符

$headers .= "MIME-Version: 1.0"."\r\n";
$headers .= "Content-type: text/html; charset=utf-8"."\r\n";
这应该是你所需要的

我可能错了,但据我所知,
iso-UTF-8
不是有效的字符集,至少看起来不是

这应该是你所需要的

我可能错了,但据我所知,
iso-UTF-8
不是有效的字符集,至少看起来不是