<?php



   $email_to = "kapparikishan@gmail.com";
   
   $email_subject = "Contact form submitted from VISPL Website";
    
    $first_name = $_POST['name']; // required
    $email_from = $_POST['email']; // required
    $phone = $_POST['phone']; // required
    $comments = $_POST['subject']; // not required
    $message = $_POST['message']; // not required
    
    
   
    
    $email_message = "Form details below.\n\n";
 

    $email_message .= "Full Name: ".$first_name."<br>";
    $email_message .= "Email: ".$email_from."<br>";
    $email_message .= "Phone: ".$phone."<br>";
    $email_message .= "Comments: ".$comments."<br>";
    $email_message .= "Message: ".$message;
 
 
/*	$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"MIME-Version: 1.0\r\n";
$headers.= 'X-Mailer: PHP/' . phpversion();
*/
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= 'Bcc: nikhiltricks@gmail.com';


$retval = mail($email_to, $email_subject, $email_message, $headers);  

if($retval == '1')
{
 $retval = '1';
 echo "<script>window.location.href = 'contact.php';alert('Contact Form Submitted Successfully');</script>";
}
else
{
    $retval = '2';
    echo "<script>window.location.href = 'contact.php';alert('something went wrong. Please Try again');</script>";
}

//echo "retval".$retval;

//echo "<script>window.location.href = 'thankyou.php?retval=$retval';</script>";



?>