-
Notifications
You must be signed in to change notification settings - Fork 2
/
contact-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 = 'vijay.panwar@nachron.com';
$to = 'jainishshah@yahoo.com'; // note the comma
//$to .= 'info@nachron.com';
// 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 <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Contact Us <info@nachron.com>' . "\r\n";
// $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
// $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
// Mail it
if(mail($to, $subject, $message, $headers))
{
echo "success";
}
?>