<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';


//Load Composer's autoloader
require 'vendor/autoload.php';

// Create a new PHPMailer instance
$mail = new PHPMailer();

// Set up SMTP
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'aaadriversacademyca@gmail.com'; // Your Gmail email address
$mail->Password = 'vjqzkpbuigajmtcq'; // Your Gmail password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS
//$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
$mail->Port = 587;

// Sender information
$mail->setFrom('aaadriversacademyca@gmail.com', 'Your Name'); // Your Gmail email address and your name

// Recipient information
$mail->addAddress('harkaranseo@gmail.com', 'Recipient Name'); // Recipient email address and name

// Email content
$mail->isHTML(true);
$mail->Subject = 'Subject of the Email';
$mail->Body = 'This is the body of the email.';

// Send the email
if ($mail->send()) {
    echo 'Email has been sent successfully!';
} else {
    echo 'Error: ' . $mail->ErrorInfo;
}
?>
