-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontactForm.php
More file actions
51 lines (36 loc) · 1.05 KB
/
contactForm.php
File metadata and controls
51 lines (36 loc) · 1.05 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
49
50
51
<?php
if($_POST["message"]) {
mail("datascience@binghamtonsa.org", "Website Notification", $_POST["message"], "From: The Website");
}
?>
<?php
if($_POST["submit"]) {
$recipient="DataScience@binghamtonsa.org";
$subject=$_POST["subject"];
$sender=$_POST["name"];
$senderEmail=$_POST["email"];
$message=$_POST["message"];
$mailBody="Name: $sender\nEmail: $senderEmail\n Subject: $subject\n$message";
mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>");
$thankYou="<p>Thank you! Your message has been sent.</p>";
}
?>
<!-- <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Contact form to email</title>
</head>
<body>
<?=$thankYou ?>
<form method="post" action="contact.php">
<label>Name:</label>
<input name="sender">
<label>Email address:</label>
<input name="senderEmail">
<label>Message:</label>
<textarea rows="5" cols="20" name="message"></textarea>
<input type="submit" name="submit">
</form>
</body>
</html> -->