-
Notifications
You must be signed in to change notification settings - Fork 1
/
function.mail
49 lines (39 loc) · 1.41 KB
/
function.mail
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
<?PHP
#######################################################
# This script is Copyright 2003, Infinity Web Design #
# Distributed by http://www.webdevfaqs.com #
# Written by Ryan Brill - ryan@infinitypages.com #
# All Rights Reserved - Do not remove this notice #
#######################################################
## The lines below need to be edited...
###################### Set up the following variables ######################
#
$to = "eightball007@hotmail.com"; #set address to send form to
$subject = "Survey Estimate Request"; #set the subject line
$forward = 1; # redirect? 1 : yes || 0 : no
$location = "thanks.html"; #set page to redirect to, if 1 is above
#
##################### No need to edit below this line ######################
## set up the time ##
$date = date ("l, F jS, Y");
$time = date ("h:i A");
## mail the message ##
$msg = "On $date at $timehe, the following Survey Estimate Request was submitted via the Brinkman Surveying website.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you!. We'll get back to you as soon as possible.";
}
?>