DataObjects/core.sql
[Pman.Core] / Mailer.php
index 3d560cb..2a46d47 100644 (file)
@@ -215,7 +215,9 @@ class Pman_Core_Mailer {
 //        print_r($parts);exit;
         if($this->attachments){
             //if got a attachments
+            $contentType = 'Content-Type: text/plain; charset=utf-8';
             if (isset($parts[1]['Content-Type'])) {
+                $contentType = $parts[1]['Content-Type'];
                 unset($parts[1]['Content-Type']);
             }
             $random_hash = md5(date('r', time()));
@@ -226,6 +228,8 @@ $str = "
 Content-Type: multipart/alternative; boundary=alt-$random_hash
 
 --alt-$random_hash
+Content-Type: $contentType
+
 {$parts[2]}
 
 --alt-$random_hash--
@@ -235,8 +239,9 @@ Content-Type: multipart/alternative; boundary=alt-$random_hash
 foreach($this->attachments as $attch){
 $str .= "
 --mixed-$random_hash
-Content-Type: {$attch['mimetype']}; ".(empty($attch['name'])) ? '' : "name=\"{$attch['name']}\"
-Content-Transfer-Encoding: base64 
+Content-Type: {$attch['mimetype']}; ".
+((empty($attch['name'])) ? '' : "name=\"{$attch['name']}\"") .
+"Content-Transfer-Encoding: base64 
 Content-Disposition: attachment
 
 {$attch['file']}