There were two things wrong with your code.
This line:
if($_SERVER['Request_Method'] != 'POST') {
Request_Method
must be in uppercase REQUEST_METHOD
because it is a superglobal
And the dollar $
in front of mail()
$mail($emailto, $subject, $message, $header);
which should be:
mail($emailto, $subject, $message, $header);
Reformatted and working PHP/HTML form
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST') {
$self = $_SERVER['PHP_SELF'];
?>
<form method="POST" action="<?php echo $self; ?>">
<table>
<tr>
<td style="width:100px;">
Name:
</td>
<td>
<input style="width:150px; height:25px;" placeholder="First Name" type="text" id="custname" name="custname">
</td>
</tr>
<tr>
<td>
</td>
<td>
<input style="width:150px; height:25px;" placeholder="Last Name" type="text" id="cust2name" name="cust2name">
</td>
</tr>
<tr>
<td>
Email:
</td>
<td>
<input style="width:250px; height:25px;" placeholder="Example@domain.com" type="text" id="custemail" name="custemail">
</td>
</tr>
<tr>
<td>
Subject:
</td>
<td>
<input style="width:250px; height:25px;" placeholder="RE:Appointment & Contact" type="text" id="textsubject" name="textsubject">
</td>
</tr>
<tr>
<td>
Message:
</td>
<td>
<textarea id="custtext" name="custtext" placeholder="Please enter your message here..." rows="6" style="resize:none; font-family:arial; width:500px; height:75px;"cols="25"></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="Send"><input type="reset" value="Clear">
</td>
</tr>
</table>
</form>
<?php
} else {
$name = $_POST['custname'];
$email = $_POST['custemail'];
$text = $_POST['custtext'];
$subject = $_POST['textsubject'];
$emailto = "email@domain.com";
$header = "From: $name <$email>\r\nReply-To: $email\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type:text/html;charset=iso-8859-1\r\n";
$message = "From: $name, Email: $email<br /><hr />$text";
mail($emailto, $subject, $message, $header);
echo "Your email has been sent, it will be proccessed within 48hours.";
}
?>