<?php session_start();


$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$message=$_POST['message'];


 if ($_POST['name'] == "") {
$error = "Please, Enter Name!";
header ("location:contacts.php?error=$error");
exit;}
 
if ($_POST['email'] == "") {
$error = "Please, Enter E-mail!";
header ("location:contacts.php?error=$error");
exit;}

 if ($_POST['phone'] == "") {
$error = "Please, Enter Phone!";
header ("location:contacts.php?error=$error");
exit;}
 
if ($_POST['message'] == "") {
$error = "Please,Enter Message!";
header ("location:contacts.php?error=$error");
exit;}


$ToEmail = "info@mountsymongroup.com";
$ToSubject = "INFORMATION";

$EmailBody =   "Name: $name\n 
Email: $email\n
Phone: $phone\n
Message: $message\n";

$Message = $EmailBody;


$headers .= "Content-type: text; charset=iso-8859-1\r\n";
$headers .= "From:".$email."\r\n";

$error1="Successfully Sent, We will be in touch with you very soon!";
 
header("location:contacts.php?error=$error1");

mail($ToEmail,$ToSubject,$Message, $headers);
?>
<?php 
mysql_close();
?>