-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdform.php
23 lines (22 loc) · 854 Bytes
/
gdform.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
try {
$from = $_POST['formEmail'];
$phone = $_POST['formNumber'];
$firstName = $_POST['formFirstName'];
$lastName = $_POST['formLastName'];
$comments = $_POST['formComments'];
$organization = $_POST['formOrganization'];
if(!empty($from) && !empty($phone) & !empty($firstName) & !empty($lastName) & !empty($comments) & !empty($organization)){
$to = "[email protected]";
$subject = "New Web Form submission";
$body = "Web form filled out by: " . $firstName . " ". $lastName . " with " . $organization . "\r\nEmail address: " . $from . "\r\nPhone #: " . $phone . "\r\nComments: " . $comments;
$headers = "From:" . $from;
mail($to,$subject,$body,$headers);
echo "True";
} else {
echo "False";
}
} catch (Exception $e) {
http_response_code(500);
}
?>