<?php
$name=$_POST['name'];
$email=$_POST['email'];
$contactno=$_POST['contactno'];
$requirement=$_POST['requirement'];
if(!empty($email))
{
		$ToEmail ="info@anandvan.org";
		$EmailSubject = 'Contact request from '.$name; 
		$mailheader = "From: ".$name." <".$email."> \r\n"; 
		$mailheader .= "Reply-To: ".$email."\r\n"; 
		$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
		$messagebody = "<p style='font-size:14px; line-height:20px;'>Dear Admin,<br/><br/>
			The customer details are as follows:
			<br/>
			<strong>Name</strong>:  $name <br/>
			<strong>Email Address</strong>:  $email <br/>
			<strong>Phone number</strong>:  $contactno <br/>
			<strong>Requirement</strong>:  $requirement <br/>
			<br/><br/>
			Regards,<br/>
			Team Parishram Enterprises</p>";
		//echo $messagebody; exit;
		$sendmail = mail($ToEmail,$EmailSubject,$messagebody,$mailheader); 	
	if($sendmail)
	{  
	?>
		<script>
			alert("Thank you for contacting us. We will be in touch with you very soon.");
			window.location.assign("contact-us.html");
		</script>
	<?php
	}
	else
	{  
	?>
		<script>
			alert("An error occurred while trying to submit your post. Please try again.");
			window.location.assign("contact-us.html");
		</script>
	<?php
	}
} else { 
?>
<script>
			alert("Please enter a valid email address");
			window.location.assign("contact-us.html");
</script>
<?php
}							
?>