From b00f42b04b3f326d06f1ebd7ab4f53bd5de59f9f Mon Sep 17 00:00:00 2001 From: Philipp Grau Date: Mon, 26 Feb 2024 14:10:04 +0100 Subject: [PATCH] Update to use the Debian libphp-phpmailer package. --- README | 2 ++ bin/rt-diff.php | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README b/README index 2105a9d..9bd4c5a 100644 --- a/README +++ b/README @@ -1,3 +1,5 @@ +Updated to use the Debian libphp-phpmailer package. + ---------------------------------------------------------------------------------------- DESCRIPTION diff --git a/bin/rt-diff.php b/bin/rt-diff.php index a9ec57d..009eae4 100644 --- a/bin/rt-diff.php +++ b/bin/rt-diff.php @@ -52,8 +52,11 @@ chdir($rtwwwroot); include ('inc/init.php'); -include ("$rtdiffroot/lib/class.phpmailer.php"); -include ("$rtdiffroot/lib/class.smtp.php"); +# Use the Debian libphp-phpmailer package, the old local stuff is outdated! +require("/usr/share/php/libphp-phpmailer/autoload.php"); +use PHPMailer\PHPMailer\PHPMailer; +use PHPMailer\PHPMailer\SMTP; +use PHPMailer\PHPMailer\Exception; date_default_timezone_set('GMT'); $ts = date("Ymd-His"); @@ -107,6 +110,8 @@ ## Send email report: $email = new PHPMailer; + # If you need smtp debugging, uncomment the next line: + # $email->SMTPDebug = SMTP::DEBUG_SERVER; $email->isSMTP(); $email->CharSet = "UTF-8"; $email->Host = $smtphost;