<?php

$arival=strip_tags($_POST[arival]);
$departure=strip_tags($_POST[departure]);
$type=strip_tags($_POST[type]);
$patients=strip_tags($_POST[patients]);
$people=strip_tags($_POST[people]);
$name=strip_tags($_POST[name]);
$contact=strip_tags($_POST[contact]);
$email=strip_tags($_POST[email]);


list($userName2, $mailDomain2) = split("@",$email); 
	

if(checkdnsrr($mailDomain2, "MX")){

$Body = "
<table width=500 cellspacing=0 cellpadding=0 ><tr><td height=30 align=center valign=middle><font face=verdana size=3 color=#000080><B>Book Now:  Thonse Healthcare</b></font></td><tr><td height=30 align=center valign=middle><hr color=#000000></td><tr></table>";
$Body = $Body . "<table width=600 cellspacing=0 cellpadding=0 >";
$Body = $Body . "<tr><td width=300 height=20 align=left valign=top><font size=2 face=verdana><b>Arival Date: </b></font></td><td><font size=2 face=verdana>". $arival."</font></td></tr>";
$Body = $Body . "<tr><td width=300 height=20 align=left valign=top><font size=2 face=verdana><b>Departure Date: </b></font></td><td><font size=2 face=verdana>". $departure."</font></td></tr>";
$Body = $Body . "<tr><td width=300 height=20 align=left valign=top><font size=2 face=verdana><b>Type of Room: </b></font></td><td><font size=2 face=verdana>". $type."</font></td></tr>";
$Body = $Body . "<tr><td height=20 align=left valign=top><font size=2 face=verdana><b>No. of Patients: </b></font></td><td><font size=2 face=verdana>" .$patients."</font></td></tr>";
$Body = $Body . "<tr><td height=20 align=left valign=top><font size=2 face=verdana><b>Accompanying People:</b></font></td><td><font size=2 face=verdana>" .$people."</font></td></tr>";
$Body = $Body . "<tr><td height=20 align=left valign=top><font size=2 face=verdana><b>Your Name: </b></font></td><td><font size=2 face=verdana>" .$name."</font></td></tr>";
$Body = $Body . "<tr><td height=1 align=left valign=top></td></tr>";
$Body = $Body . "<tr><td height=20 align=left valign=top><font size=2 face=verdana><b>Contact No.:</b></font><br></td><td><font size=2 face=verdana>" .$contact."</font></td></tr>";
$Body = $Body . "<tr><td height=1 align=left valign=top><font size=2 face=verdana><b>Email ID:</b></font></td><td><font size=2 face=verdana>" .$email."</font><br></td></tr>";
$Body = $Body . "<tr><td height=1 align=left valign=top></td></tr>";
$Body = $Body . "</table>
";

$message=$Body; 
$to="Zaffer55@hotmail.com, thonsehealth@yahoo.com, thonsehealth@gmail.com, praveenshriyan@gmail.com, shriyan.r@gmail.com";
$from_email="$email";
$subject = "Book Now:  Thonse Healthcare";
	//$subject = "Enquiry -$contact_person.";
$mailheaders = '';
$mailheaders.= "from: ".$from_email." \r\n";
$mailheaders.= "MIME-Version: 1.0" . "\r\n";
$mailheaders.= "Content-type: text/html; charset=ISO-8859-1" . "\r\n";


if(!mail($to,$subject,$message,$mailheaders)) {

		//echo "<b></b> Query was not sent <b>Sorry</b><br />";
echo   "<script>
           alert('Please Try Again ')
           history.go(-1);
           </script>";
 }
				
			               
	                      
else{
	header('Location: submitted1.htm');
        die;
					
         }




    }
else{
//echo"Your Email id is not validate";
//header('Location: contactus.htm');

 echo   "<script>
           alert('Please enter a valid email id ')
           history.go(-1);
           </script>";
}
?>