From: Janusz Dobrowolski Date: Mon, 31 Aug 2015 06:45:40 +0000 (+0200) Subject: Small cleanups in mail class. X-Git-Tag: v2.4.2~19^2~147 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=183d4be97acdca496543a8dc23520f84d8761707 Small cleanups in mail class. --- diff --git a/reporting/includes/class.mail.inc b/reporting/includes/class.mail.inc index 26a109fd..e40ffe8d 100644 --- a/reporting/includes/class.mail.inc +++ b/reporting/includes/class.mail.inc @@ -69,7 +69,7 @@ class email { if (!isset($filename)) $filename = basename($file); - $this->attachment[$filename] = $file; + $this->attachment[$filename] = $file; } function subject($subject) @@ -128,10 +128,8 @@ class email $this->header .= "Content-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n"; // Add Attachments - $max = count($this->attachment); - if ($max > 0) + if (!empty($this->attachment)) { - for ($i = 0; $i < $max; $i++) foreach ($this->attachment as $filename => $file) { $file = fread(fopen($file, "r"), filesize($file));