-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction_page.php
More file actions
18 lines (17 loc) · 830 Bytes
/
action_page.php
File metadata and controls
18 lines (17 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
if(isset($_POST['submit'])){
$to = "leighton.h.carpenter@gmail.com"; // this is your Email address
$from = $_POST['Email']; // this is the sender's Email address
$name = $_POST['Name'];
$subject = $_POST['Subject'];
$subject2 = "Copy of " . $_POST['Subject'];
$message = $name . " " . " wrote the following:" . "\n\n" . $_POST['Message'];
$message2 = "Here is a copy of your message " . $name . "\n\n" . $_POST['Message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
}
?>