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

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

function send_mail_smtp($to,$subject,$body)
{
    $mail = new PHPMailer(true);

    try {
        $mail->isSMTP();
        $mail->Host = 'mail.privateemail.com';
        $mail->SMTPAuth = true;
        $mail->Username = 'info@julms.com';
        $mail->Password = 'You$of2030';
        $mail->SMTPSecure = 'tls';
        $mail->Port = 587;

        $mail->setFrom('info@julms.com','Conference System');
        $mail->addAddress($to);

        $mail->Subject = $subject;
        $mail->Body    = $body;

        $mail->send();
    } catch (Exception $e) {
        // silent fail or log later
    }
}
