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

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

function sendMail($to,$subject,$message){

$mail = new PHPMailer(true);

$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'certiva.limited@gmail.com';
$mail->Password = 'lufjpiekcnpltvsx';
//$mail->Password = 'gsxcbesejondrwuy';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;

$mail->setFrom('certiva.limited@gmail.com','Certiva Limited');
$mail->addAddress($to);

$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body    = $message;

$mail->send();
}
?>