From 915c67dc2e4690339babd872632a7eb47a805d63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Apr 2006 01:10:38 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20option=20cach=E9=20pour=20d=E9sactiver?= =?UTF-8?q?=20tout=20mail=20(pour=20les=20syst=E8mes=20sans=20sendmail)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/lib/CMailFile.class.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index 55e839c8c2c..ce1f986354d 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * 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 @@ -159,6 +159,8 @@ class CMailFile */ function sendfile() { + global $conf; + $headers = $this->smtp_headers . $this->mime_headers; $message=$this->text_body . $this->text_encoded; @@ -176,17 +178,20 @@ class CMailFile $errorlevel=error_reporting(); //error_reporting($errorlevel ^ E_WARNING); // Désactive warnings - if ($this->errors_to) + if (! $conf->global->MAIN_DISABLE_ALL_MAILS) { - dolibarr_syslog("CMailFile::sendfile with errorsto : ".$this->errors_to); - $res = mail($this->addr_to,$this->subject,stripslashes($message),$headers,"-f".$this->errors_to); - } - else - { - dolibarr_syslog("CMailFile::sendfile"); - $res = mail($this->addr_to,$this->subject,stripslashes($message),$headers); - } - //if (! $res) $this->error= + if ($this->errors_to) + { + dolibarr_syslog("CMailFile::sendfile with errorsto : ".$this->errors_to); + $res = mail($this->addr_to,$this->subject,stripslashes($message),$headers,"-f".$this->errors_to); + } + else + { + dolibarr_syslog("CMailFile::sendfile"); + $res = mail($this->addr_to,$this->subject,stripslashes($message),$headers); + } + //if (! $res) $this->error= + } error_reporting($errorlevel); // Réactive niveau erreur origine //$this->write_to_file();