From 183d4be97acdca496543a8dc23520f84d8761707 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 31 Aug 2015 08:45:40 +0200 Subject: [PATCH] Small cleanups in mail class. --- reporting/includes/class.mail.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)); -- 2.30.2