From 355f3d44af3a9a8120e214b72f37d78919e7adb8 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 11 Mar 2026 12:23:52 +0100 Subject: [PATCH] fixes #2538 differentiate from and reply-to in pwg_mail --- include/functions_mail.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index 6eebe62ff..dece9e645 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -594,6 +594,8 @@ SELECT * @param string|array $to * @param array $args * o from: sender [default value webmaster email] + * o reply_to_mail_address: reply-to can be different of the "from" (new 16.4.0) [default value empty] + * o reply_to_name: reply-to can be different of the "from" (new 16.4.0) [default value empty] * o Cc: array of carbon copy receivers of the mail. [default value empty] * o Bcc: array of blind carbon copy receivers of the mail. [default value empty] * o subject [default value 'Piwigo'] @@ -654,7 +656,7 @@ function pwg_mail($to, $args=array(), $tpl=array()) $from = unformat_email($args['from']); } $mail->setFrom($from['email'], $from['name']); - $mail->addReplyTo($from['email'], $from['name']); + $mail->addReplyTo($args['reply_to_mail_address'] ?? $from['email'], $args['reply_to_name'] ?? $from['name']); // Subject if (empty($args['subject']))