我的剧本:
$message = "
<html>
<head>
<title>Birthday Reminders for August</title>
<style>td,tr{border:solid 1px black;}</style>
<meta charset='UTF-8'>
</head>
<body>
<table>
<tr><td>სახელი</td><td>{$_POST['firstname']}</td></tr>
<tr><td>გვარი</td><td>{$_POST['lastname']}</td></tr>
<tr><td>დაბადების თარიღი</td><td>{$_POST['birthday']}</td></tr>
<tr><td>მოქალაქეობა</td><td>{$_POST['cityzen']}</td></tr>
<tr><td>პირადი ნომერი</td><td>{$_POST['id_number']}</td></tr>
</table>
</body>
</html>
";
// To send HTML mail, the Content-type header must be set
//MUSHA
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; utf-8' . "\r\n";
// Additional headers
$headers .= 'To: Mary <aaa.wwww@gmail.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\n";
// Mail it
mail($to, $subject, $message, $headers);
我已经在gmail.com,yahoo.com,outlook.com上测试了它,一切都很棒。
但在MS Outlook中存在UTF-8问题。
答案 0 :(得分:0)
尝试使用:
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
答案 1 :(得分:0)
尝试添加
header("Content-type:text/html;charset=utf-8");
到你的php文件的顶部。您使用的是哪个版本的Outlook?