Server : Apache System : Linux 122.228.205.92.host.secureserver.net 5.14.0-362.18.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 29 07:05:48 EST 2024 x86_64 User : ondostategov ( 1002) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/ondostategov/public_html/ondo_ict_registration2/inc/ |
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php'; // Path to PHPMailer
$mail = new PHPMailer(true);
try {
// Server settings
$mail->SMTPDebug = 3;
$mail->isSMTP(); // Use SMTP
$mail->Host = 'twentyseven.qservers.net'; // Set the SMTP server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'no-reply@sita.on.gov.ng'; // SMTP username
$mail->Password = 'Softd_2025'; // SMTP password (App Password if 2FA is on)
$mail->SMTPSecure = 'ssl'; // Enable encryption
$mail->Port = 465;
$mail->SMTPOptions = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
];
// Recipients
$mail->setFrom('no-reply@sita.on.gov.ng', 'SITA');
$mail->addAddress('omotayotemi47@gmail.com', 'Temidayo'); // Add a recipient
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Hello from PHPMailer';
$mail->Body = 'This is a <b>test email</b> sent using PHPMailer.';
$mail->AltBody = 'This is a plain-text version of the email content.';
$mail->send();
echo 'Message has been sent successfully!';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>