-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacknowledge.php
31 lines (25 loc) · 875 Bytes
/
acknowledge.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
<?php
if (isset($_POST['submit'])) {
$to = '[email protected]'; // Use your own email address
$subject = 'Feedback from my site';
$message = 'Name: ' . $_POST['cf_name'] . "\r\n\r\n";
$message .= 'Email: ' . $_POST['cf_email'] . "\r\n\r\n";
$message .= 'Comments: ' . $_POST['cf_message'];
$headers = "From: [email protected]\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8';
$email = filter_input(INPUT_POST, 'cf_email', FILTER_VALIDATE_EMAIL);
if ($email) {
$headers .= "\r\nReply-To: $email";
}
$success = mail($to, $subject, $message, $headers);
}
?>
<body>
<?php if (isset($success) && $success) { ?>
<h1>Thank You</h1>
<p>Your message has been sent.</p>
<?php } else { ?>
<h1>Oops!</h1>
<p>Sorry, there was a problem sending your message.</p>
<?php } ?>
</body>