PK

ADDRLIN : /home/anibklip/mannhvacservices.ca/
FLL :
Current File : //home/anibklip/mannhvacservices.ca/mail.php

<?php 
// print_r($_POST);

if(isset($_POST['email'])){
    //$to = "mypratyush@gmail.com";
    $to = "mannductless@gmail.com";
    $from = 'info@mannhvacservices.ca';
    
    $first_name = $_POST['name'];
    $email = $_POST['email'];
    
    $msg="";
    foreach($_POST as $k=>$v){
        $msg.=ucfirst($k).": $v \n";
    }
    
    $subject = "An Appointment request from website mannhvacservices.ca";
    
    $message = $first_name." wrote the following:" . "\n\n".$msg;
    $message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];

    $headers = "From:" . $from;
    
    mail($to,$subject,$message,$headers);
    
    echo "Appointment request Sent. Thank you " . $first_name . ", Our team will confirm your request shortly.";
    // You can also use header('Location: thank_you.php'); to redirect to another page.
    }
?>


PK 99