<?php 

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


$SITE_URL = 'microgagefin.com';
$KEY = 'UZ7osnzR3SWVqwW!';
$toEmail = 'edeypay@gmail.com';
$notificationSubject = 'test';
$messageBody = 'This is the HTML message body <b>in bold!Testing</b>';

function sendMailWithPHPMailer($toEmail, $notificationSubject, $messageBody)
{
global $SITE_URL, $KEY;
require 'autoload.php';
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'smtp.hostinger.com';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = "support@{$SITE_URL}";
$mail->Password = $KEY;
$mail->setFrom("support@{$SITE_URL}", 'Support');
$mail->addReplyTo("support@{$SITE_URL}", 'Support');
$mail->addAddress(89, $toEmail);
$mail->Subject = $notificationSubject;
//$mail->msgHTML(file_get_contents('message.html'), _DIR_);
$mail->msgHTML($messageBody);
// $mail->Body = $messageBody;
//$mail->addAttachment('attachment.txt');
if (!$mail->send()) {
return false;
} else {
return true;
}
}