I replaced the code with the new lines you sent, and received these Warnings & Error Message:
Warning: Use of undefined constant ‘PHPMailer - assumed ‘‘PHPMailer’ (this will throw an Error in a future version of PHP) in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: Use of undefined constant src - assumed ‘src’ (this will throw an Error in a future version of PHP) in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: A non-numeric value encountered in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: A non-numeric value encountered in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: Division by zero in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: Use of undefined constant Exception - assumed ‘Exception’ (this will throw an Error in a future version of PHP) in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: A non-numeric value encountered in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: Division by zero in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: Use of undefined constant php’ - assumed ‘php’’ (this will throw an Error in a future version of PHP) in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: require(NANphp’): failed to open stream: No such file or directory in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Warning: require(NANphp’): failed to open stream: No such file or directory in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Fatal error: require(): Failed opening required ‘NANphp’’ (include_path=’.:/opt/cpanel/ea-php74/root/usr/share/pear’) in /home2/hdlenhan/public_html/CardSender/0-MailTester.php on line 33
Here is what my code looks like now:
<html>
<head>
<title>PHP HDL Mail Tester </title>
<style>
body, TD{
font-family: 'verdana';
font-size: '13px';
}
</style>
</head>
<body bgcolor="#d0d0d0">
<?PHP
// Allow this page to display error messages
error_reporting(E_ALL);
ini_set("display_errors", 1);
// Set up links to the PHPmailer library
require ‘PHPMailer/src/Exception.php’;
require ‘PHPMailer/src/PHPMailer.php’;
require ‘PHPMailer/src/SMTP.php’;
use PHPMailer\PHPMailer;
use PHPMailer\Exception;
use PHPMailer\SMTP;
// Set up new PHPmailer connection and set to SMTP version
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
//This is in a loop that selects just ONE Recipent… ( Set up recipient info which is just an email address )
$mail->AddAddress("***********");
// Set up user information and server information
$mail->Username = "**********";
$mail->Password = "***********";
$mail->SetFrom = "************";
$mail->Subject = "TEST EMAIL ! ";
$mail->Body = "JUST IGNORE THIS EMAIL, TESTING PHPmailer SYSTEM ! ";
// Send message to current recipient
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
?>
</body>
</html>