-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontactengine.php
More file actions
47 lines (39 loc) · 1003 Bytes
/
contactengine.php
File metadata and controls
47 lines (39 loc) · 1003 Bytes
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
<?php
$EmailFrom = "felix@blackspike.com";
$EmailTo = "felix@blackspike.com";
$Subject = "Email from website contact form";
$Name = Trim(stripslashes($_POST['name']));
$Email = Trim(stripslashes($_POST['email']));
$Message = Trim(stripslashes($_POST['message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=contacterror.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
/*
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contacterror.htm\">";
}
*/
?>