<?php
$name = $_POST['name'];
$email = $_POST['email'];
$contact = $_POST['contact'];
$subject = $_POST['subject'];
$message = $_POST['message'];
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$to = "
[email protected]";
$subject = "Enquiry Through Website";
$headers = 'From: XYZ <
[email protected]>' . PHP_EOL .
'Reply-To: XYZ <
[email protected]>' . PHP_EOL .
'X-Mailer: PHP/' . phpversion();
$email_body = "Full Name: " . $name . "\r\n" .
"Email ID: " . $email . "\r\n" .
"Contact Number: " . $contact . "\r\n" .
"Subject: " . $subject . "\r\n" .
"Message: " . $message ;
mail($to,$subject,$email_body, $headers);
header("Location:thankyou.html");
?>