<?php
// Include PHPMailer class file
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
require 'PHPMailer/src/Exception.php';

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

// Create a new PHPMailer instance
$mail = new PHPMailer();

// SMTP settings
$mail->isSMTP();
$mail->Host = 'mail.smtp2go.com';
$mail->SMTPAuth = true;
$mail->Username = 'jobcards@tsebysoft.com'; // Your email address
$mail->Password = 'L@vidaloca05'; // Your email password
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;

// Sender and recipient settings
$mail->setFrom('jobcards@tsebysoft.com', 'peacelion');
$mail->addAddress('raymondkeitshokile@gmail.com');

// Email content
$mail->isHTML(false);
$mail->Subject = 'Test Email';
$mail->Body = 'This is a test email sent via SMTP using PHPMailer skohoko.';

// Send email
if($mail->send()) {
    echo 'Email sent successfully awee!';
} else {
    echo 'Email sending failed.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
}
?>
