<?php 
if(isset($_POST['submit'])){
    $to = "vinu.k@galantilife.com"; // this is your Email address
    $from = $_POST['email']; // this is the sender's Email address
    $name = $_POST['name'];
    
    $phone = $_POST['phone'];
    
    $subject = "GALANTI";
    $subject2 = "GALANTI";
    $message = "Name: ". $name . "\n"  . "Email: ". $from . "\n" . "Phone: ". $phone;
    $message2 = "Thank you, we'll get in touch with you soon";

    $headers = "From:" . $from;
    $headers2 = "From:" . $to;
    mail($to,$subject,$message,$headers);
    mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
   echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.alert('Thank you, we'll get in touch with you soon');
    window.location.href='https://www.galantilife.com/';
    </SCRIPT>");
    // You can also use header('Location: thank_you.php'); to redirect to another page.
    }
?>