<?php
if(isset($_POST['send-message']))
    {
                // echo'hi';
                // print_r($_POST);
                $name=$_POST['name'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$property=$_POST['subject'];
$message=$_POST['message'];
//   neelam.crowncrest@gmail.com
$to = "info@anantarafarms.com";
$subject = "Website Enquiry Data";

$output ="
<html>
<head>
<title>Send Messages</title>
</head>
<body>
<p>Send Messages!</p>
<table border='1'>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Date Of Function</th>
<th>Subject</th>
<th>Message</th>
</tr>
<tr>
<td>$name</td>
<td>$phone</td>
<td>$email</td>
<td>$property</td>
<td>$message</td>
</tr>
</table>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <'.$email.'>' . "\r\n";
$headers .= 'Cc: info@anantarafarms.com' . "\r\n";

$mail_send = mail($to,$subject,$output,$headers);   
if($mail_send){
//   header('Location: https://crowncrestrealty.com/thank-you');
  echo "<script>
window.location = 'https://vedantarafarms.com/thanks';</script>";
}else{
    echo "Something Went Wrongs";
}
            }
?>