<?php 
error_reporting(E_ALL); ini_set('display_errors', 1);
include("./mailer/class.phpmailer.php");


  $name         = $_POST['name'];

  $client_email        = 'contact@citoinfotech.com';

  $customer_email        = $_POST['email'];

  $mobile       = $_POST['mobile'];

  $message  = $_POST['message'];

$filename = $_FILES["attachmentFile"]["name"];

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



move_uploaded_file($_FILES["attachmentFile"]["tmp_name"], "career/" . $filename);

  $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>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->WordWrap = 50;
  $mail->IsHTML(true);

  $mail->Subject = $subject_thankyou;

  $mail->Body    = $message_thankyou;

  $mail->AltBody = $subject_thankyou;

$file_to_attach = "career/" . $filename; 

$mail->AddAttachment( $file_to_attach , $filename);

 
$mail->IsHTML(true);
if(!$mail->Send()) {
  echo "Problem in Sending Mail.";
} else {
  echo "Contact Mail Sent.";
}


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

            <?php
        }
        else
        {
          ?>

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