I am receiving blank emails from my website every day at 8:15am - 8:19am. They don't contain any information in them and do not contain the input id's either.
I have gone through multiple forums about this but I am new to PHP and seams to be a bit over my head.
<?php
function sendFormByEMail($msgBody) {
$to = "email@gmail.com";
$subject = "web visitor";
$from = "email@gmail.com";
$mailHdr = "";
$mailHdr .= "From: ".$from."
";
$mailHdr .= "Reply-To: ".$from."
";
return mail($to, $subject, $msgBody, $mailHdr);
}
function getMessageText() {
$msgTxt = "";
$msgTxt .= "Sent: " . date("Y/m/d H:i:s") . "
";
foreach ($_POST as $key => $value)
{
//$msgTxt .= urlencode($key) . "=" . urlencode($value) . "
";
$msgTxt .= $key . " = " . $value . "
";
}
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>
I have been trying to fix this for a few weeks now and any help would be GREATLY appreciated.