-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.php
More file actions
48 lines (36 loc) · 1.22 KB
/
form.php
File metadata and controls
48 lines (36 loc) · 1.22 KB
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
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<h1>Email sent.</h1>
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message']
$email_subject = "New Form Submission";
$email_body = "You have received a new message from the user $name.\n".
"Respond to email address: \n $email \n"
"Message:\n $message"
$headers = "From: $email_from \r\n"
$headers .= "Reply-To: $email \r\n"
$email_to = "a.m.chan.1210@gmail.com"
mail($email_to, $email_subject, $email_body, $headers);
// if(isset($_POST['submit'])){
// // Collect form data
// $name = $_POST['name'];
// $email = $_POST['email'];
// // Set recipient email address
// $to = "a.m.chan.1210@gmail.com";
// // Set email subject
// $subject = "New Form Submission";
// // Set email message
// $message = "Name: ".$name."\nEmail: ".$email;
// // Set email headers
// $headers = "From: ".$email."\r\n" .
// "Reply-To: ".$email."\r\n" .
// "X-Mailer: PHP/" . phpversion();
// // Send email
// mail($to, $subject, $message, $headers);
// // Redirect to thank you page
// header("Location: thankyou.html");
// exit;
?>
</html>