diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e7bcb208a1e..b2149cd187f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -58,6 +58,8 @@ class CMailFile public $alternative_boundary; public $deliveryreceipt; + public $atleastonefile; + public $eol; public $eol2; @@ -338,8 +340,7 @@ class CMailFile $text_body = $this->write_body($msg); // Add attachments to text_encoded - if ($this->atleastonefile) - { + if (!empty($this->atleastonefile)) { $files_encoded = $this->write_files($filename_list, $mimetype_list, $mimefilename_list); } @@ -401,7 +402,7 @@ class CMailFile } } - if ($this->atleastonefile) + if (!empty($this->atleastonefile)) { foreach ($filename_list as $i => $val) { @@ -530,7 +531,7 @@ class CMailFile $this->message->addPart(dol_nl2br($msg), 'text/html'); } - if ($this->atleastonefile) + if (!empty($this->atleastonefile)) { foreach ($filename_list as $i => $val) {