<?php 
if(isset($_POST['submit'])){
    //$to = "devisettyraju@gmail.com";
	$to = "karan.singh@srsjuris.in";
    
    $name = $_POST['name']; // this is the sender's Email address
    $phone = $_POST['phone'];
      $Email = $_POST['email'];
     $message = $_POST['message'];
     
    $subject = "Contact form";
    $subject2 = "Copy of your form submission";
    $message =  " CLIENT CONTACT DETAILS  :" . "\n\n" ." Client Name : " . $_POST['name'] . "\n\n"." E-mail  : " . $_POST['email'] .  "\n\n"." Mobile :" . $_POST['phone']. "\n\n"."Message : " . $_POST['message'];
    // $message =  " CLIENT CONTACT DETAILS  :" . "\n\n" ." Mobile : " . $_POST['phone'] . "\n\n"." Client Name : " . $_POST['name'] .  "\n\n"."E-mail :" . $_POST['email'].  "\n\n"."location : " . $_POST['location']."\n\n"."Message : " . $_POST['message'];
    $message2 = "Here is a copy of your message " . $name . "\n\n" . $_POST['phone'];

    $headers = "From:" .  $name;
    $headers2 = "From:" . $to;
      mail($to,$subject,$message,$headers);
    mail($from,$subject2,$message2,$headers2); 
    // sends a copy of the message to the sender

// echo "<script>
//     window.location = 'thankyou.html';
// </script>";
    // to redirect to another page.
    }
?>