From d919c5fd1ebf319a058006762869d68ebbf6d7e4 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 30 Apr 2026 16:58:17 +0200 Subject: [PATCH] SMTPMail Sendmail_Core: align blind_copy and reply_to --- include/lib/sendmail_core.class.php | 5 ++++- include/lib/smtpmail.class.php | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/lib/sendmail_core.class.php b/include/lib/sendmail_core.class.php index a4d031e9e..b34cd6e11 100644 --- a/include/lib/sendmail_core.class.php +++ b/include/lib/sendmail_core.class.php @@ -52,6 +52,7 @@ class Sendmail_Core // for postfix, it should be "-f {$this->from}" for the Return-Path protected $phpmailer; //!< PHPMailer object; protected $blind_copy; //!< email of blind copy (list of emails separated by comma) + protected $reply_to; //!< reply to function __construct() { @@ -231,7 +232,9 @@ class Sendmail_Core { $this->phpmailer->addBCC($a_blind_copy[$i]); } - + if ( ! empty ($this->reply_to)) { + $this->phpmailer->addReplyTo($this->reply_to); + } $this->phpmailer->preSend(); } diff --git a/include/lib/smtpmail.class.php b/include/lib/smtpmail.class.php index 60319abfe..1d2e92f74 100644 --- a/include/lib/smtpmail.class.php +++ b/include/lib/smtpmail.class.php @@ -90,11 +90,16 @@ class SMTPMail } /** - * @param mixed $blind_copy + * @param string $blind_copy list of emails BCC separated by a comma */ public function setBlindCopy($blind_copy): SMTPMail { - $this->phpmailer->addBCC($this->blind_copy); + $a_blind_copy=explode(",",$blind_copy??""); + $nb_blind_copy=count($a_blind_copy); + for ($i=0;$i<$nb_blind_copy;$i++) + { + $this->phpmailer->addBCC($a_blind_copy[$i]); + } return $this; }