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

require_once dirname(__DIR__, 2) . '/vendor/autoload.php';


$mail = new PHPMailer(true);

try {

    $mail->isSMTP();

    $mail->Host = 'mail.findcarrierjob.com';
    $mail->SMTPAuth = true;
    $mail->Username = 'info@findcarrierjob.com';
    $mail->Password = '(z_,o1r9s~MsFAD?';
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
    $mail->Port = 465;

    $mail->setFrom('info@findcarrierjob.com', 'Carrier Jobs');
    $mail->addAddress($senderMail);
    $mail->addReplyTo('info@findcarrierjob.com', 'Carrier Jobs');

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


    $mail->send();
    // echo 'Message has been sent successfully';
} catch (Exception $e) {
    // echo 'Mail failed';
}
