-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactsend.php
42 lines (36 loc) · 934 Bytes
/
contactsend.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$From = "Starta-co New Website"
$to = "[email protected]";
$subject = "Starta-co Contact Form";
$name = Trim(htmlspecialchars(stripcslashes($_POST['name1'])));
$email = Trim(htmlspecialchars(stripcslashes($_POST['email'])));
$message = Trim(htmlspecialchars(stripcslashes($_POST['msg']));
// Validation
$validationOK = true;
if( !$validationOK)
{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactusError.php\">";
exit;
}
// Prepare The Email Body Text
$Body = "";
$Body .= "Name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "Email : ";
$Body .= $email;
$Body .= "\n";
$Body .= "Message ";
$Body .= $message;
//Send Email
$success = mail ($to, $subject, $Body, "From: Mr./Mm <$name>");
// Redirect To Success Page
if($success)
{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactusThanks.php\">"
}
else
{
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactusError.php\">";
}
?>