From dcac229700a32823ab3f3e78019101cea4632fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 2 Aug 2022 11:01:09 +0200 Subject: [PATCH] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 94fb05d5346..7acd7ac3db0 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-2020 Frédéric France + * Copyright (C) 2019-2022 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 @@ -547,10 +547,18 @@ class CMailFile } if (!empty($this->addr_cc)) { - $this->message->setCc($this->getArrayAddress($this->addr_cc)); + try { + $this->message->setCc($this->getArrayAddress($this->addr_cc)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } } if (!empty($this->addr_bcc)) { - $this->message->setBcc($this->getArrayAddress($this->addr_bcc)); + try { + $this->message->setBcc($this->getArrayAddress($this->addr_bcc)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } } //if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) {