这是我的代码:
$content =
writeExamDetails() .
writeStudnetDetails() .
writeAnswers($numOfQuestions);
if ($_POST['studentComments']!=null) {
$content .= "<p align=\"" . $text['align'] . "\"><strong>" .
$text['studentComments'] .
":</strong><br />" .
formatStr($_POST['studentComments']) .
"</p>";
}
$body = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" >
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
<title>" .
$text['emailResultsPageTitle'] .
"</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
direction: " . $text['dir'] . ";
text-align: " . $text['align'] . ";
}
</style>
</head>
<body>
<p dir=\"ltr\" style=\"color:#999999;\">
If you cannot view the following contents properly, change the Encoding to Unicode (UTF-8).</p>" .
$content;
$body .= "<hr noshade=\"noshade\" height=\"1\" /><p>" .
$text['emailResultsDurationTitle'] . ": " .
duration((int)($_POST['lapsedTime']/1000)) .
"</p>
</body>
</html>";
$subject = "" . trim(stripslashes(stripslashes($_POST['examTitle'])));
//formatStr2html($_POST['examTitle']);
if (isset($_POST['studentId'])){
$subject .= " (ID: " . $_POST['studentId'] . ")";
}
$headers = "From: " . $from . "\n" . $cc .
"Subject: " . $subject ."\n" .
"X-Mailer: PHP/" . phpversion() . "\n" .
"MIME-Version: 1.0\n" .
"X-Priority: 1\n" . "Importance: High\n" . "X-MSMail-Priority: High\n" .
"Content-Type: text/html; charset=iso-8859-1\n";
"Content-Transfer-Encoding: 8bit\r\n\r\n";
$result = mail ($to, $subject, $body, $headers);
这就是它在希伯来语中的样子(我希望你理解希伯来语)
在浏览器中(正确)--->“אחת שתים בדיקה אחת שתים בדיקה”
在电子邮件中(不正确)--->“אחת שת�ם בדיקה אחת שתים בדי�קה”