-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
24 lines (23 loc) · 855 Bytes
/
send.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
<?php
if (!empty($_POST["name"]) && !empty($_POST["email"])&& isset($_POST["submit"])){
$to = '[email protected]';
$subject = 'message from ' . $_POST["name"];
$message = $_POST["name"] . " wrote the following: \n"
. $_POST["comment"] . "\n This person can be reached at " . $_POST["email"];
$headers = 'From: ' . $_POST["name"] . "\r\n" .
'Reply-To: jacobmorra.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
$cond = true;
}
else if ((empty($_POST["name"]))&& !empty($_POST["email"])&& isset($_POST["submit"])){
$cond1 = true;
}
else if (!empty($_POST["name"]) && (empty($_POST["email"]))&& isset($_POST["submit"])){
$cond2 = true;
}
else if (empty($_POST["name"]) && (empty($_POST["email"]))&& isset($_POST["submit"])){
unset($_POST["submit"]);
$cond3 = true;
}
?>