forked from kashyapvyas/trpwsweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontactus.php
32 lines (27 loc) · 948 Bytes
/
contactus.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
<!--php script to send email-->
<?php
//variable declaration
$name = $_POST['name']; //name of sender
$email = $_POST['email']; // email of sender
$phone = $_POST['phone']; //phone no. of sender
$message = $_POST['message']; //message by sender
//form content
$formcontent="From: $name \n Phone no.: $phone \n Message: $message";
$recipient = ""; // recipient email
$subject = "TRPWS - Contact Form "; //Email Subject
$mailheader = "From: $email \r\n"; //mail header
mail($recipient, $subject, $formcontent, $mailheader) ;
//showing alert and redirected to contact page
echo "<script>
setTimeout(SWAL, 1000);
function SWAL(){
swal('Thanks!', 'Your Message Sent Successfully!', 'success');
}
setTimeout(OUT, 2000);
function OUT(){
window.location.href = '/contactus.html';
}
</script>";
?>
<!--sweet alert cdn-->
<script src='https://unpkg.com/sweetalert/dist/sweetalert.min.js'></script>