-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
34 lines (29 loc) · 885 Bytes
/
mail.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
<?php
if(isset($_POST['submit'])){
//****************************************
$senderEmail = $_POST['email'];
$targetEmail = 'mail@bibeksubedi.com.np';
$messageSubject = 'Message from BibekSubedi.Com.np';
$redirectToReferer = true;
//****************************************
// mail content
$uname = $_POST['name'];
$uemail = $_POST['email'];
$utele = $_POST['tele'];
$umessage = $_POST['message'];
$messageText = 'Name: '.$uname."\n".
'Email: '.$uemail."\n".
'Telephone: '.$utele."\n".
'Message: '.$umessage."\n";
$messageHeaders = 'From: '.$senderEmail."\r\n".
'Reply-To: '.$senderEmail."\r\n".
'X-Mailer: PHP/'.phpversion();
mail($targetEmail, $messageSubject, $messageText, $messageHeaders);
// redirect
if($redirectToReferer) {
header("Location: ".@$_SERVER['HTTP_REFERER']);
} else {
header("Location: ".$redirectURL);
}
}
?>