我每天上午8:15 - 8:19收到来自我网站的空白电子邮件。 它们中不包含任何信息,也不包含输入ID。
我已经通过多个论坛讨论过这个问题,但我不熟悉PHP和接缝有点过头了。
<?php
function sendFormByEMail($msgBody) {
$to = "email@gmail.com";
$subject = "web visitor";
$from = "email@gmail.com";
$mailHdr = "";
$mailHdr .= "From: ".$from."\r\n";
$mailHdr .= "Reply-To: ".$from."\r\n";
return mail($to, $subject, $msgBody, $mailHdr);
}
function getMessageText() {
$msgTxt = "";
$msgTxt .= "Sent: " . date("Y/m/d H:i:s") . "\n";
foreach ($_POST as $key => $value)
{
//$msgTxt .= urlencode($key) . "=" . urlencode($value) . "\n";
$msgTxt .= $key . " = " . $value . "\n";
}
return $msgTxt;
}
if (sendFormByEMail(getMessageText())) {
$nextPage = '../index2.html';
} else {
$nextPage = '../index2.html';
}
header("Location: $nextPage");
?>
HTML
<form action="php/formsProcessor.php" method="post" enctype="multipart/form-data" name="quote" id="quote">
<div class="row">
<label for="name">Your name:</label><br />
<input id="name" class="input" name="name" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="email">Your email:</label><br />
<input id="email" class="input" name="email" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="message">Your message:</label><br />
<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br />
</div>
<input id="submit_button" type="submit" value="Send email" />
</form>
我一直试图解决这个问题几个星期,任何帮助都会非常感激。
答案 0 :(得分:0)
将此文字添加到标题中: &#34;内容类型:text / html charset = iso-8859-1 \ r \ n&#34;