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

require '../vendor/autoload.php';

$mail = new PHPMailer(true);

try {
    //Server settings
    $mail->isSMTP();
    $mail->Host       = 'mail.srsainvestments.com';   // Replace with your SMTP host
    $mail->SMTPAuth   = true;
    $mail->Username   = 'noreply@srsainvestments.com'; // Your SMTP email
    $mail->Password   = ')etOQbXFGjsr';   // App password if using Gmail
    $mail->SMTPSecure = 'tls';                // 'ssl' or 'tls'
    $mail->Port       = 587;                  // 465 for SSL, 587 for TLS

    //Recipients
    $mail->setFrom('noreply@srsainvestments.com', 'srsainvestments');
    $mail->addAddress('jrdeve123@yopmail.com', 'Test Dev Name');

    //Content
    $mail->isHTML(true);
    $mail->Subject = 'SMTP Test Email';
    $mail->Body    = 'This is a test email sent via SMTP using PHPMailer.';
    $mail->AltBody = 'This is a plain text version of the email.';

    $mail->send();
    echo 'Message has been sent successfully';
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}