
<?php 

if(isset($_POST['submit']))
{
  $name=$_POST['name'];
 
  $mobile=$_POST['mobile'];
  $company=$_POST['company'];
  $emailid=$_POST['emailid'];
  $city=$_POST['city'];
 
  $subject="Contact Form ( Amaeka - Website )";
 
  $mail=$_POST['email'];
  $mainmsg=$_POST['mainmsg'];

  $check1=$_POST['check1'];
  $check2=$_POST['check2'];
  $check3=$_POST['check3'];
  $check4=$_POST['check4'];
  $check5=$_POST['check5'];
  $check6=$_POST['check6'];
  
  
 
   $sendon=date('F j, Y, g:i A');
  $pageaddress=$_SERVER['HTTP_REFERER'];

  
//  $to=$contact90;
  $to='joaijo93@gmail.com';
  
  $headers="";
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  
   $headers .= 'From: <'.$mail.'>'. "\r\n";
    $headers .= 'Reply-To: '.$mail.' '."\r\n" ;
    $headers .= 'Return-Path:<'.$mail.'>'."\r\n";
    $headers .= "X-MSMail-Priority: Normal\r\n";
    $headers .= 'X-Mailer: PHP/' . phpversion();
  $headers .= "X-Priority: 3\r\n";
    $headers .= "Organization: My Organization\r\n"; 
  
  
  $mailbody= '<table width="100%" border="1" align="center" cellpadding="5" cellspacing="2">';
  $mailbody.='<tr><td colspan="2"><strong><font size="+1">'.$subject.'</font></strong></td></tr>';
  
  
  $mailbody.='<tr><td width="30%" height="20">Name</td><td width="70%">'.$name.'</td></tr>';
  $mailbody.='<tr><td width="30%" height="20">Email</td><td width="70%">'.$mail.'</td></tr>';
  $mailbody.='<tr><td width="30%" height="20">Phone</td><td width="70%">'.$phone.'</td></tr>';
  $mailbody.='<tr><td width="30%" height="20">Interested Service </td><td width="70%">'.$interested.'</td></tr>';
  $mailbody.='<tr><td width="30%" height="20">Additional Notes</td><td width="70%">'.$notes.'</td></tr>';
  
  $mailbody.='</table>';
  
  $a=@mail($to,$subject,$mailbody,$headers);
  if($a)
  {

   $name=$_POST['name'];
     
  $email=$_POST['email']; 
  
    
  $pageaddress=$_SERVER['HTTP_REFERER'];
  
 
  $to1=$_POST['email'];
  $subject1="Amaeka"; 
  $headers1="";
  $headers1 .= "MIME-Version: 1.0\r\n";
  $headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";
  
    $headers1 .= 'From: <'.$to.'>'. "\r\n";
    $headers1 .= 'Reply-To: '.$to.' '."\r\n" ;
    $headers1 .= 'Return-Path:<'.$to.'>'."\r\n";
    $headers1 .= "X-MSMail-Priority: Normal\r\n";
    $headers1 .= 'X-Mailer: PHP/' . phpversion();
    $headers1 .= "X-Priority: 3\r\n";
    $headers1 .= "Organization: My Organization\r\n"; 
  
  
  $mailbody1= '<table width="100%" border="0" align="center" cellpadding="5" cellspacing="2">';
  $mailbody1.='<tr><td colspan="2"><strong><font size="+1">'.$subject1.'</font></strong></td></tr>';
  $mailbody1.='<tr><td colspan="2"><strong>Dear '.$name.',<br><br>

   Thank you for Arrange Consultation with Amaeka. We’re happy to Inform latest  news,updates and any questions you may have and aim to respond within 24 hours. In the meantime, please feel free to contact us by   +91 8089909365</span></span> </strong></td></tr>';
  $mailbody1.='<tr><td colspan="2"><br><br><strong>Regards : Amaeka </strong></td></tr>';
  
   
  $mailbody1.='</table>';
  
  
  
  
  $a1=@mail($to1,$subject1,$mailbody1,$headers1);
  
  echo '<script type="text/javascript">alert("Thank You For Your Consultation");window.location.href="'.$pageaddress.'";</script>';
  }
  else
  {
  echo '<script type="text/javascript">alert("Somethinhg Went To Wrong, Please Try Again Later");window.location.href="'.$pageaddress.'";</script>';
  }
} 
?>

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}

input[type=text], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=submit] {
  background-color: #4CAF50;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #45a049;
}

.container {
  border-radius: 5px;
  background-color: #f2f2f2;
  padding: 20px;
}
</style>
</head>
<body>

<h3>Contact Form</h3>

<div class="container">
  <form action="" method="post">
    <label for="fname">First Name</label>
    <input type="text" id="fname" name="name" placeholder="Your name..">

    <label for="lname">Last Name</label>
    <input type="text" id="lname" name="mobile" placeholder="Your last name..">
    
     <label for="lname">Last Name</label>
    <input type="text" id="lname" name="email" placeholder="Your last name..">


    <input type="submit" name="submit" value="Submit">
  </form>
</div>

</body>
</html>