Skip to content

Commit

Permalink
Small cleanups in mail class.
Browse files Browse the repository at this point in the history
  • Loading branch information
itronics committed Aug 31, 2015
1 parent 1239da7 commit 183d4be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions reporting/includes/class.mail.inc
Expand Up @@ -69,7 +69,7 @@ class email
{
if (!isset($filename))
$filename = basename($file);
$this->attachment[$filename] = $file;
$this->attachment[$filename] = $file;
}

function subject($subject)
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 183d4be

Please sign in to comment.