我用下面的代码来发送电子邮件:PHP mail();如何设置字符集为主题和电子邮件
<?php
$to = $_POST['email'];
$subject = "Subject!";
$message = "Hello!";
$headers = "From: Me<[email protected]>\r\n";
$headers .= "Return-Path: [email protected]\r\n";
$headers .= "BCC: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";
mail($to,$subject,$message,$headers);
?>
虽然使用charset=utf-8
在主题和电子邮件地址线的人物仍然没有得到解码对。我收到了这样的字符:ößä
。
如何设置主题和电子邮件地址的字符集呢?
你检查所提供的答案吗?如果它是正确的,请接受它。谢谢! – Dekel