I have a problem with my contact form
Filling in the form is OK etc, but when I send the message, I only receive the telephone nr.
This is PHP code from sendmail.
<?php
if (isset($_POST["submit"])) {
// Checking For Blank Fields..
if ($_POST["name"] == "" || $_POST["email"] == "" || $_POST["tel"] == "") {
echo "Fill All Fields..";
} else {
// Check if the "Sender's Email" input field is filled out
$email = $_POST['email'];
// Sanitize E-mail Address
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
// Validate E-mail Address
$email = filter_var($email, FILTER_VALIDATE_EMAIL);
if (!$email) {
echo "Invalid Sender's Email";
} else {
$subject = 'neuen Kontakt';
$message = $_POST['name'];
$message = $_POST['email'];
$message = $_POST['tel'];
$headers = 'From:' . $email2 . "\r\n"; // Sender's Email
$headers .= 'Cc:' . $email2 . "\r\n"; // Carbon copy to Sender
// Message lines should not exceed 70 characters (PHP rule), so wrap it
//$message = wordwrap($message, 70);
// Send Mail By PHP Mail Function
mail("mymail@gmail.com", $subject, $message, $headers);
echo "Your mail has been sent successfuly ! Thank you for your feedback";
}
}
}
?>
and this is the html form
<form action="index.php" method="post" name="contactus" id="contactus" onsubmit="return ValidateForm();">
<table width="260" border="0" cellspacing="0" cellpadding="0" align="center" style="color:#FFF">
<tr>
<td height="25px" style="font-family:Arial; font-size:13px; color:#575757; padding:0 0 0 10px;">Name<span style="color:#F00">*</span>
</td>
</tr>
<tr>
<td style="padding:0 0 0 10px;">
<input name="name" type="text" class="input" id="name" onFocus="inputFocus(this)" onBlur="inputBlur(this)" value="" />
</td>
</tr>
<tr>
<td height="27px" style="font-family:Arial; font-size:13px; color:#575757; padding:0 0 0 10px;">Telefonnummer<span style="color:#F00">*</span>
</td>
</tr>
<tr>
<td class="td_style1">
<input name="tel" type="text" class="input" id="email" onFocus="inputFocus(this)" onBlur="inputBlur(this)" value="" />
</td>
</tr>
<tr>
<td height="25px" style="font-family:Arial; font-size:13px; color:#575757; padding:0 0 0 10px;">E-mail<span style="color:#F00">*</span>
</td>
</tr>
<tr>
<td style="padding:0 0 0 10px;">
<input name="email" type="text" class="input" id="email" onFocus="inputFocus(this)" onBlur="inputBlur(this)" value="email@gmail.com" />
</td>
</tr>
<tr>
<td style="padding:10px 28px 0 0;" align="right">
<input name="submit" type="submit" value="SUBMIT" class="submit" />
</td>
</tr>
<tr>
<td height="20px" style="font-family:Arial; font-size:11px; color:#575757; padding:3px 27px 0 0px; float:right;"><span style="color:#F00">*</span> sind Pflichtfelder</td>
</tr>
</table>