here is the code I am using in the email.php file I have on the server.
There is also a javascript document that validates the form.
go to: rougedesignonline.com/contact.html to see the form
<?php
$EmailFrom = Trim(stripslashes($POST['EmailFrom']));
$EmailTo = "example@example.com";
$Subject = "Website Inquiry";
$Name = Trim(stripslashes($POST['Name']));
$First_Name = Trim(stripslashes($POST['First_Name']));
$Last_Name = Trim(stripslashes($POST['Last_Name']));
$Address1 = Trim(stripslashes($POST['Address1']));
$Address2 = Trim(stripslashes($POST['Address2']));
$City = Trim(stripslashes($POST['City']));
$State = Trim(stripslashes($POST['State']));
$ContactBy = Trim(stripslashes($POST['ContactBy']));
$Phone = Trim(stripslashes($POST['Phone']));
$email = Trim(stripslashes($POST['email']));
$Message = Trim(stripslashes($POST['Message']));
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "First_Name: ";
$Body .= $First_Name;
$Body .= "\n";
$Body .= "Last_Name: ";
$Body .= $Last_Name;
$Body .= "\n";
$Body .= "Address1: ";
$Body .= $Address1;
$Body .= "\n";
$Body .= "Address2: ";
$Body .= $Address2;
$Body .= "\n";
$Body .= "City: ";
$Body .= $City;
$Body .= "\n";
$Body .= "State: ";
$Body .= $State;
$Body .= "\n";
$Body .= "ContactBy: ";
$Body .= $ContactBy;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "email: ";
$Body .= $email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<script type=\"text/javascript\">alert(\"Thank you for your form submission.\")</script><meta http-equiv=\"refresh\" content=\"0;URL=index.html\">";
}
else{
print "<script type=\"text/javascript\">alert(\"There was an error with the submission.\")</script><meta http-equiv=\"refresh\" content=\"0;URL=index.html\">";
}
?>