<?php 
class mail{
	function mail_send(){
		if (isset($_POST['submit']))
{
	echo'text';
	$name=$_POST['name'];
	$email=$_POST['email'];
	$phno=$_POST['phone'];
	
	$msg=$_POST['message'];
	$to  = 'enquiry@spdventure.com';
	$from='enquiry@spdventure.com';
	$subject = 'CUSTOMER ENQUIRY ';
	$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = '
<html>
<head>
  <title>Customer Details</title>
</head>
<body>
  <table width="90%"; rules="all" style="border:1px solid #3A5896;" cellpadding="10">
    <tr>
      <th>Name</th>
	   <th>E-Mail id</th>
	   <th>Phone number</th>
		
		<th>Comments</th>
    </tr>
	<tr>
	<td >'.$name.'</td>
	<td >'.$email.'</td>
	<td >'.$phno.'</td>
	
	<td >'.$msg.'</td>
	</tr>
  </table>
</body>
</html>';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$from.'' . "\r\n";
if(mail($to, $subject, $message, $headers)){
echo "<script type='text/javascript'>alert('Send Sucessfully');</script>";
echo "<script type='text/javascript'>window.location.href = 'contact.html';</script>";
}
else{
	echo "<script type='text/javascript'>alert('not Send Sucessfully');</script>";
echo "<script type='text/javascript'>window.location.href = 'contact.html';</script>";
}
}
	}
}
$m=new mail();
$m->mail_send();
?>