I have a little problem with my email script that I can't figure out why it's doing this. The email gets sent but no from email address is in the email and no text.
Here is the HTML code for the form.
<form id="facilitator" name="facilitator" method="post" action="http://www.mysite.com/emailf/email.php">
<table width="100%" border="0" align="center">
<tr>
<td width="176"><div align="right">
<label for="email2">Email:</label>
</div></td>
<td width="167"><div align="left">
<input name="email" type="text" id="email" size="35" maxlength="80" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="name">Full Name:</label>
</div></td>
<td><div align="left">
<input name="name" type="text" id="name" size="35" maxlength="80" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="phone">Phone Number:</label>
</div></td>
<td><div align="left">
<input name="phone" type="text" id="phone" size="35" maxlength="14" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="comments">Comments:</label>
</div></td>
<td><div align="left">
<textarea name="comments" id="comments" cols="38" rows="5"></textarea>
</div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><div align="left"></div></td>
</tr>
<tr>
<td><div align="right">
<label for="clear"></label>
<input type="reset" name="clear" id="clear" value="Reset Form!" />
</div></td>
<td><div align="left">
<label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Submit Email!" />
</div></td>
</tr>
<tr>
<td colspan="2"><div align="right"></div> <div align="left"></div></td>
</tr>
</table>
</form>
This is the PHP code to send the email.
<?php
/* Subject and Email Variables */
$emailSubject = 'Facilitor at Warfighter Tech!';
$webMaster = 'myemail@email.com';
/* Gathering Data Variables */
$emailField = $POST['email'];
$nameField = $POST['name'];
$phoneField = $POST['phone'];
$commentsField = $POST['comments'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone Number: $phone <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content=type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>Warfighter Tech Facilitor Job</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>
<div>
<div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
This is what I get in an email.
I get the Subject but no return email address and this is whats in the email.
<br><hr><br>
Email: <br>
Name: <br>
Phone Number: <br>
Comments: <br>
Can anyone help me out?
Thanks