我收到CP1252的邮件,因为有了cyrylics需要UTF-8。
我的PHP代码:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$to = '...@mail.com';
$from = '...@mail.com';
$subject = 'SUBJECT';
$body='par1: '.$_POST['par1'].'Message: '.$_POST['message'];
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
}
...
<head>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
我也有
<form method="post" action="" accept-charset="UTF-8" >
我尝试了很多选项,但无论如何都有CP1252的邮件。 如何为这个问题找到正确的解决方案?