1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
if($_POST){
	
	//your email address
	$email_to = "[email protected]";
	//email subject
	$emailSubject = "Professional Detailing contact form";
	//edit the emailfrom
	$emailFrom = "[email protected]";
	
	$first_name = $_POST['first_name'];
	$last_name = $_POST['last_name'];
	$email = $_POST['email'];
	$phone = $_POST['phone'];
	$message = $_POST['message'];
	
	$text = "FIRST_NAME: $first_name<br>
	         LAST_NAME: $last_name<br>
	         EMAIL: $email<br> 
	         PHONE: $phone<br>  
	         MESSAGE: $message";
	$headers = "MIME-Version: 1.0" . "\r\n"; 
	$headers .= "Content-type:text/html; charset=utf-8" . "\r\n"; 
	$headers .= "From: <$emailFrom>" . "\r\n";
	mail($email_to, $emailSubject, $text, $headers);
	$data['success'] = true;
	echo json_encode($data);
}
?>