DataObjects/core.sql
[Pman.Core] / Mailer.php
index 83210f4..c7417c3 100644 (file)
@@ -213,8 +213,12 @@ class Pman_Core_Mailer {
         
         if(!empty($this->attachments)){
             //if got a attachments
-            
             $header = $mime->headers($parts[1]);
+            
+            if (isset($parts[1]['Content-Type'])) {
+                unset($parts[1]['Content-Type']);
+            }
+            
             if (!$isMime) {
             
                 if(preg_match('/text\/html/', $header['Content-Type'])){
@@ -229,8 +233,8 @@ class Pman_Core_Mailer {
                 $mime->addAttachment(
                         $attch['file'],
                         $attch['mimetype'],
-                        $attch['name'],
-                        false
+                        (!empty($attch['name'])) ? $attch['name'] : '',
+                        true
                 );
             }