-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
30 lines (30 loc) · 1.45 KB
/
contact.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
<?php
// if ($_POST["submit"]<>'') {
// $ToEmail = '[email protected]';
// $EmailSubject = 'Site contact form';
// $mailheader = "From: ".$_POST["email"]."\r\n";
// $mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
// $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
// $MESSAGE_BODY = "Name: ".$_POST["name"]."";
// $MESSAGE_BODY .= "Email: ".$_POST["email"]."";
// $MESSAGE_BODY .= "Comment: ".($_POST["message"])."";
// mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
// echo "success";
// }
//$toEmail = "[email protected]";
//$mailHeaders = "From: " . $_POST["name"] . "<". $_POST["email"] .">\r\n";
$ToEmail = '[email protected]';
//$ToEmail = '[email protected]';
$EmailSubject = "Subject: ".$_POST["form_subject"];
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br/>";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br/>";
$MESSAGE_BODY .= "Comment: ".($_POST["form_message"])."<br/>";
if(mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader)) {
print "<p class='success'>Thank you! will get back in touch with you soon!.</p>";
} else {
print "<p class='Error'>Problem in Sending Mail.</p>";
}
?>