<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

  
</head>

<body>
<?php

ob_start();

if(isset($_POST['bookoneway']))
{
 

    
require("class.phpmailer.php");

$mail = new PHPMailer();
// Settings
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';

//Your SMTP servers details
$mail->Host       = "mail.aviatorsinfotech.in"; // SMTP server example
$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Port       = 587;                    // set the SMTP port for the GMAIL server
$mail->Username = "mailenquiry@aviatorsinfotech.in";  // SMTP username
$mail->Password = "b@MN!C.K5Gr{"; // SMTP password

//It should be same as that of the SMTP user

$redirect_url = "http://".$_SERVER['SERVER_NAME']; //Redirect URL after submit the form
$mail->From =  $mail->Username;// $mail->Username;	//Default From email same as smtp user


$mail->FromName = $_POST['name'];
	

$mail->AddAddress("hashamali7@gmail.com");

$mail->AddAddress("car2gocabservice@gmail.com");


$mail->WordWrap = 50;                                 // set word wrap to 50 characters
$mail->IsHTML(true);                                  // set email format to HTML

$mail->Subject = "Message from Website CAR2GOCAB Pickup Form";
$message = "Pickup City : ".$_POST['pickup'].
"\r\n <br>Drop City : ".$_POST['drop'].
"\r\n <br>Mobile Number : ".$_POST['mbno'];

 

$mail->Body    = $message;

if(!$mail->Send())
{?>
  <script language="javascript" type="text/javascript">
	alert('Message failed.');
	window.location = 'http://car2gocab.com/';
  </script>
<?php
}
else{
?>
<script language="javascript" type="text/javascript">
		alert('message has been sent sucessfully');
		window.location = 'http://car2gocab.com/'	;
	</script>

  <?php }
}


?>


</body>
</html>