-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_email.php
More file actions
47 lines (42 loc) · 1.28 KB
/
send_email.php
File metadata and controls
47 lines (42 loc) · 1.28 KB
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
43
44
45
46
47
<?php
if($_POST!='' && isset($_POST)){
if($_REQUEST['InputEmail']!='' || $_REQUEST['InputName']!='' || $_REQUEST['InputPhone']!='' || $_REQUEST['InputSub']!='' || $_REQUEST['InputMessage']!='')
{
$to = "muditlal02@gmail.com";
$from = strip_tags($_REQUEST['InputEmail']);
$name = strip_tags($_REQUEST['InputName']);
$phone = strip_tags($_REQUEST['InputPhone']);
$subject = strip_tags($_REQUEST['InputSub']);
$message = strip_tags($_REQUEST['InputMessage']);
$headers = 'From:'.$from. "\r\n" .
'Reply-To:'.$from. "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$subject = "You have a message sent from your site";
$body = '<html>';
$body .= '<body>';
$body .= 'Hello Webmaster,<br><br>';
$body .= 'Name: '.$name.'<br>';
$body .= 'Email: '.$from.'<br>';
$body .= 'Phone: '.$phone.'<br>';
$body .= 'Subject: '.$subject.'<br>';
$body .= 'Message: '.$message.'<br>';
$body .= '</body>';
$body .= '</html>';
$send = @mail($to, $subject, $body, $headers);
if($send == true)
{
header('location:index.html#success');
}
else
{
header('location:index.html#failed');
}
}
else
{
header('location:index.html#data-missing');
}
}
?>