<?php 
  include("./mailer/class.phpmailer.php");

  $name         = $_POST['name'];

  $client_email        = 'contact@citoinfotech.com';

  $customer_email        = $_POST['email'];

  $mobile       = $_POST['mobile'];

  $message  = $_POST['message'];
  $location  = $_POST['location'];

  if(($name != "")&&($customer_email != "")&&($mobile != "")&&($message != "")&&($location != ""))
  {


  $contact_name ="Please check Enquiry";

  $subject_thankyou = "Hi, You got new enquiry  "  ;

  $message_thankyou = "

  <p>Hi,</p>

  <table>

  <tr>

  <td>Name</td>

  <td> ".$name."</td>

  </tr>

  <tr>

  <td>Email</td>

  <td> ".$customer_email."</td>

  </tr>

  <tr>

  <td>Mobile</td>

  <td> ".$mobile."</td>

  </tr>

  <tr>

  <td>Location</td>

  <td> ".$location."</td>

  </tr>

  <tr>

  <td>Message</td>

  <td> ".$message."</td>

  </tr>

  </table>
  <br><br>
  Thanks

 ";

  $mail = new PHPMailer;

  $mail->IsSMTP(); // enable SMTP

  $mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only

  $mail->SMTPAuth  = true;  // authentication enabled

  $mail->Host     = 'smtp.mailgun.org';/*Specify main and backup SMTP servers*/

  $mail->SMTPSecure = 'TLS';

  $mail->Port     = '2525';

  $mail->SMTPAuth = 'true';/*Enable SMTP authentication*/

  $mail->Username = 'enquiry@mg.lamppostmedia.in';/*SMTP username*/

  $mail->Password = 'Lampp@st2017Enquiry';/*SMTP password*/

  $mail->setFrom('contact@citoinfotech.com', 'New Enquiry');

  $mail->addAddress($client_email , $name);

  $mail->isHTML(true);

  $mail->Subject = $subject_thankyou;

  $mail->Body    = $message_thankyou;

  $mail->AltBody = $subject_thankyou;

  $mail->send();


         ?>
              <script type="text/javascript">
               window.location.href="thank-you";
            </script>

            <?php
        }
        else
        {
        	?>

              <script type="text/javascript">
               window.location.href="contact.php";
            </script>
        	<?php
        }
        ?>