-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_contact.php
40 lines (31 loc) · 1.05 KB
/
send_contact.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
38
39
40
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$yourName = $_POST['name'];
$yourMail = $_POST['customer_mail'];
$yourSubject = $_POST['subject'];
$yourPhoneNumber = $_POST['Phone_number'];
$yourMessage = $_POST['comments'];
$to = '[email protected]';
$subject = 'Contact from Form Submit';
// To send HTML mail, the Content-type header must be set
$headers = 'From: '.$yourMail . "\r\n" .
'Reply-To:' .$yourMail. "\r\n" .
'X-Mailer: PHP/' . phpversion();
$message = 'Here is content from submit form'."\r\n";
$message .= 'Your Name: '.$yourName."\r\n";
$message .= 'Your Mail: '.$yourMail."\r\n";
$message .= 'Subject: '.$yourSubject."\r\n";
// if ($website !=''){
// $message .= 'Website: '.$website."\r\n";
// }
$message .= 'Your Phone Number: '.$yourPhoneNumber."\r\n";
$message .= 'Your message: '.$yourMessage."\r\n";
try {
mail($to, $subject, $message, $headers);
header('Location: thank-you.html');
exit;
}catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
?>