From 102356d2c4fdedf061936d7043e1f93a8841eebb Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 17 Nov 2023 12:01:03 +0100 Subject: [PATCH] fix: When sendmail failed it return false, result is KO, need to say it to user (#26631) * fix: When sendmail failed it return false, need to be tested as is * fix: When sendmail failed it return false, so >=0 do not trigger error * fix: When sendmail failed it return false, so >=0 do not trigger error * Update CMailFile.class.php * Update actions_sendmails.inc.php * Update actions_sendmails.inc.php * Update CMailFile.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/actions_sendmails.inc.php | 2 +- htdocs/core/class/CMailFile.class.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index a7562eb2c1e..5744316eb4a 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -370,7 +370,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $action = 'presend'; } else { $result = $mailfile->sendfile(); - if ($result >= 0) { + if ($result) { // Initialisation of datas of object to call trigger if (is_object($object)) { if (empty($actiontypecode)) { diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 63d8ab77f6e..d05854d3435 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1194,7 +1194,6 @@ class CMailFile } error_reporting($errorlevel); // Reactive niveau erreur origine - return $res; }