-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_form.php
29 lines (25 loc) · 926 Bytes
/
process_form.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
<?php
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$mail_body = "Name : ".$name."<br>";
$mail_body .= "Email : " . $email . "<br>";
$mail_body .= "Subject : " . $subject . "<br>";
$mail_body .= "Message : " . $message . "<br>";
if(mail("youremail@mail.com","From: Contact Form Your name",$mail_body,$headers)){
$thanks_mail_body = "Hello " . $name ."<br>";
$thanks_mail_body .= "Hey! Thanks for your email!<br>";
$thanks_mail_body .= "I will get back to you soon.<br>";
$thanks_mail_body .= "Thank You,<br>";
$thanks_mail_body .= "Your Name.";
if(mail($email,"Contact Request Notification Email",$thanks_mail_body,$headers)){
echo "1";
die();
}
echo "1";
}else{
echo "0";
}