/
quote-form.php
37 lines (28 loc) · 761 Bytes
/
quote-form.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
// if the url field is empty
if(isset($_POST['url']) && $_POST['url'] == ''){
// put your email address here
$youremail = '[email protected]';
// prepare message
$body = "You have got a new message from the quote form on your website - Blussom :
Name: $_POST[name]
Phone Number: $_POST[number]
Email: $_POST[email]
Subject: $_POST[subject]";
if( $_POST['email'] && !preg_match( "/[\r\n]/", $_POST['email']) ) {
$headers = "From: $_POST[email]";
} else {
$headers = "From: $youremail";
}
mail($youremail, 'Message from Blussom', $body, $headers );
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Thanks!</title>
</head>
<body>
<p> Thank you! We will get back to you soon.</p>
</body>
</html>