所有口音(
é,à,etc)在PHP mail()
函数发送的电子邮件中呈现为奇怪的字符。以下是生成此电子邮件的代码:
$email_message = '<html><body>';
$email_message .= '<table rules="all" style="border-color: #aaa;" cellpadding="10">';
$email_message .= "<tr><td style='background: #eee;'><strong>FIRST NAME:</strong> </td><td>" . $form_first_name . "</td></tr>";
$email_message .= "<tr><td style='background: #eee;'><strong>LAST NAME:</strong> </td><td>" . $form_last_name . "</td></tr>";
$email_message .= "<tr><td style='background: #eee;'><strong>MESSAGE:</strong> </td><td>" . $form_message . "</td></tr>";
$email_message .= "</table>";
$email_message .= "</body></html>";
$email_message = nl2br( $email_message );
$sender = $form_email;
$reply_to = $form_email;
$email_headers = "From: " . strip_tags( $form_email ) . "\r\n";
$email_headers .= "Reply-To: ". strip_tags( $form_email ) . "\r\n";
$email_headers .= "MIME-Version: 1.0\r\n";
$email_headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$email_message = stripslashes( $email_message );
$result_mail_function = mail( $email_to, $email_subject, $email_message, $email_headers );
为什么重音不能正常呈现?