<?php
if(isset($_POST['spamy']) && $_POST['spamy'] == ''){
$to      = 'To: Leads Om Developcon <leads@omdevelopcon.com>';
$name = $_REQUEST["name"];
$email = $_REQUEST["email"];
$mobile = $_REQUEST["mobile"];
$verif_box = $_REQUEST["verif_box"];
$product_name =$_REQUEST["product_name"];
$subject = "Important: Site visit Leads  $product_name";
$ip = $_SERVER['REMOTE_ADDR'];
$messageto="<b><i>Dear Members,</i></b><br /><br/>
   <i><b>$name</b> has enquired for</i> <h3>$product_name</h3><br />Please contact to <b>$name</b> on details given below.<br/><br/> 
 		Name:				$name<br />
------------------------------------------------------------------<br />
		Email: 			    $email<br />
------------------------------------------------------------------<br />
		Mobile:			    $mobile<br />
------------------------------------------------------------------<br />";
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From: '.$name.' <'.$email.'>' . "\r\n";
$headers .= 'Cc: Sanskar Shukla <shukla@omdevelopcon.com>' . "\r\n";
// check to see if verificaton code was correct
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
	// if verification code was correct send the message and show this page
	mail($to, $subject, $messageto, $headers);
	// delete the cookie so it cannot sent again by refreshing this page
	setcookie('tntcon','');
	//Build Confirmation Email To The Customer
			$to2 = "$from";
			$subject2 = "Enquiry sent confirmation from Godrej Prive";
			$theEmail2 = "<h3>Thanks for Your Enquiry</h3><p>Very soon one of our representative will get in touch with you </p><p>Regards,</p><p>GODREJ Prive Team.</p>";
			$headers2 = "Content-type: text/html\r\n";
			$headers2 .= "From: no-reply@thegodrejprive.com\r\n";
			mail($to2, $subject2, $theEmail2, $headers2);
			header('Location: /thankyou.php');
	       
} else {
	// if verification code was incorrect then return to contact page and show error
	header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true");
	exit;
}
}
?>

