-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactform.php
37 lines (24 loc) · 941 Bytes
/
contactform.php
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
30
31
32
33
34
35
36
37
<?php
$post_data = file_get_contents("php://input");
$data = json_decode($post_data);
Just to display the form values
echo "Question : " . $data->question;
echo "Email : " . $data->email;
echo "phone "
echo "Message : " . $data->message;
// sned an email
$to = "[email protected]";
$subject = 'Coustomer Enquiery at all in one website';
$message = "<table border='0' cellpadding='2' cellspacing='2' width='600'>
<tr><td>Form details below:</td></tr>
<tr><td>Email: ".$data->$email."</td></tr>
<tr><td>Phone: ".$data->$phone."</td></tr>
<tr><td>Service: ".$data->$service."</td></tr>
<tr><td>Message: ".$data->$question."</td></tr>
</table>";
$headers = 'From: ' . $data->email. 'allin one website' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
//php mail function to send email on your email address
mail($to, $subject, $message, $headers);
?>