forked from jainishshah17/jainishshah.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact-form.php
54 lines (45 loc) · 1.24 KB
/
contact-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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
//echo "hello"; die;
// $to = '[email protected]';
$to = '[email protected]'; // note the comma
//$to .= '[email protected]';
// subject
$subject = 'Contact US';
// message
$message = '
<html>
<head>
<title>Contact US</title>
</head>
<body>
<table>
<tr>
<td>Name : </td><td>'.$_REQUEST['inputName'].'</td>
</tr>
<tr>
<td>Email : </td><td>'.$_REQUEST['inputEmail'].'</td>
</tr>
<tr>
<td>Number : </td><td>'.$_REQUEST['inputSubject'].'</td>
</tr>
<tr>
<td>Country : </td><td>'.$_REQUEST['inputMessage'].'</td>
</tr>
</table>
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
// $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
$headers .= 'From: Contact Us <[email protected]>' . "\r\n";
// $headers .= 'Cc: [email protected]' . "\r\n";
// $headers .= 'Bcc: [email protected]' . "\r\n";
// Mail it
if(mail($to, $subject, $message, $headers))
{
echo "success";
}
?>