<?php 
header('Access-Control-Allow-Origin: *');
// header('Content-Type: application/json');
$message="";

if(isset($_POST['rin'],$_POST['relation'],$_POST['fname'],$_POST['lname'],$_POST['father'],$_POST['mother'],$_POST['educ'],$_POST['occu'],$_POST['loc'],$_POST['tel'],$_POST['dob'],$_POST['income'] ))
{
    $from_add = "datasurvey@khandesh.site"; 
	$to_add = "faisalmshaikh@gmail.com"; //<-- put your yahoo/gmail email address here
	$subject = "Info of ". $_POST['relation'] . "(". $_POST['rin']. ")";
	$message = "First Name: " . $_POST['fname'] . "\r\nLast name: " . $_POST['lname'] . "\r\nFather: " . $_POST['father']. "\r\nMother: " . $_POST['mother'] ;
	$message .= "\r\nEducation: " . $_POST['educ'] . "\r\nOccupation: " . $_POST['occu']. "\r\nLocation: " . $_POST['loc']   ;
	$message .= "\r\nPhone: " . $_POST['tel'] . "\r\nAnnual Income: " . $_POST['income']. "\r\nDate of Birth: " . $_POST['dob']   ;
	$headers = "From: $from_add \r\n";
	$headers .= "Reply-To: $from_add \r\n";
	$headers .= "Return-Path: $from_add\r\n";
	$headers .= "X-Mailer: PHP \r\n";
	if(mail($to_add,$subject,$message,$headers)) 
	{
		print_r("Thanks! Your updates are sent for review");
	} 
	else 
	{
 	   print_r("Error");
	}
}
?>