<?php

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require_once "PHPMailer/src/PHPMailer.php";
require_once "PHPMailer/src/SMTP.php";
require_once "PHPMailer/src/Exception.php";






$mail = new PHPMailer(true);

//Enable SMTP debugging.
$mail->SMTPDebug = 0; //0 or 2 

//Set PHPMailer to use SMTP.
$mail->isSMTP();

//Set SMTP host name                          
$mail->Host = "smtp.gmail.com";

//Set this to true if SMTP host requires authentication to send email
$mail->SMTPAuth = true;

$mail->SMTPOptions = array(
    'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);

//Provide username and password     

$mail->Username = "clickexcel@gmail.com";
$mail->Password = "wdjp debz quxi hqwv";


//If SMTP requires TLS encryption then set it
$mail->SMTPSecure = "tls";

//Set TCP port to connect to
$mail->Port = 587;

$mail->From = "clickexcel@gmail.com";
$mail->FromName = "AnviCabs.com";

$mail->addAddress("anvicabs.book@gmail.com", "AnviCabs.com");

$mail->isHTML(true);
$mail->Subject = "Booking details";




$message = "
<table>
Booking details<br><br>

     Name : ".$_POST["Name"]."<br>
     Pickup Location : ".$_POST["pickuplocation"]."<br>
     Date : ".$_POST["Date"]."<br>
     Email : ".$_POST["Email"]."<br>
     Mobile : ".$_POST["Mobile"]."<br>

</table>
";

$mail->Body = $message;

try {
    $mail->send();
  echo "<br><br><br><br><h2 align=center><font color=green>Your Trip booking done sucessfully,</font><br> You will get our call shortly ! </h2>";
} catch (Exception $e) {
    echo "Mailer Error: " . $mail->ErrorInfo;
}









?>




<div align=center>

      <a href="https://www.anvicabs.com/index.html" > Back to Home Page >> </a>

</div>
