From c987f934b146ce63bbf157619c19be0f9cd591f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 13 May 2023 08:58:52 +0200 Subject: [PATCH] add returnpath for swiftmailer --- htdocs/core/class/CMailFile.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 418ef0612ba..f87bafb513d 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2019-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -512,7 +512,7 @@ class CMailFile // Give the message a subject try { - $result = $this->message->setSubject($this->subject); + $this->message->setSubject($this->subject); } catch (Exception $e) { $this->errors[] = $e->getMessage(); } @@ -557,6 +557,14 @@ class CMailFile } } + if (!empty($this->errors_to)) { + try { + $this->message->setReturnPath($this->getArrayAddress($this->errors_to)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } + } + try { $this->message->setCharSet($conf->file->character_set_client); } catch (Exception $e) {