<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<form method="post">
Email Address:
<input name="email" type="text" class="form-contril" placeholder="email address">
<input type="submit" name="btn-email" class="btn btn-success">
</form>

<?php
error_reporting(E_ALL); 
include 'phpmailer/PHPMailerAutoload.php';
if(isset($_POST['email']))
{
	
	$to=$_POST['email'];
	$message='Test Email Sent';
	$passenger='Jas Brar';
	function send_passenger_email($to,$message,$passenger)
		 {
			 echo "Email Started";
		$to=$to;
		$message=$message;   
		$passenger=$passenger;
		$mail->SMTPAuth   = true;
		$mail = new PHPMailer;
		$mail->IsHTML(true);  
		$mail->setFrom('info@limochauffeurs.com', 'Limo Chauffeurs Ltd.');
		$mail->addAddress($to, $passenger);
		$mail->Subject  = 'Passenger Booking Confirmation';
		$mail->Body     =$message;
		
		if(!$mail->send()) {
		  echo 'Message was not sent.';
		  echo 'Mailer error: ' . $mail->ErrorInfo;
		  }else{
			  echo "Email Sent Sucessfully";
		  }
		}
	$sent=send_passenger_email($to,$message,$passenger);
	if($sent){echo "Email Sent";}
     
}
?>
</body>
</html>
