DataObjects/Core_notify.php
[Pman.Core] / Mailer.php
index 5f7235c..ff25d5e 100644 (file)
@@ -133,7 +133,7 @@ class Pman_Core_Mailer {
         $tmp_opts['nonHTML'] = true;
         
         
-        
+        //print_R($tmp_opts);
         // $tmp_opts['force'] = true;
         $template = new HTML_Template_Flexy(  $tmp_opts );
         
@@ -159,24 +159,27 @@ class Pman_Core_Mailer {
             //exit;
         } 
         
-        
+        require_once 'Mail/mime.php';
+        $mime = new Mail_mime(array(
+            'eol' => "\n",
+            //'html_encoding' => 'base64',
+            'html_charset' => 'utf-8',
+            'text_charset' => 'utf-8',
+            'head_charset' => 'utf-8',
+        ));
+        // clean up the headers...
         
         
         $parts[1]['Message-Id'] = '<' .   $content->msgid   .
                                      '@' . $content->HTTP_HOST .'>';
         
-        
-        
-        
+          
         if ($htmlbody !== false) {
-            require_once 'Mail/mime.php';
-            $mime = new Mail_mime(array('eol' => "\n",
-//                                    'html_encoding' => 'base64',
-                                    'html_charset' => 'utf-8',
-                                    'text_charset' => 'utf-8',
-                                    'head_charset' => 'utf-8'
-                ));
+            // got a html headers...
             
+            if (isset($parts[1]['Content-Type'])) {
+                unset($parts[1]['Content-Type']);
+            }
             $mime->setTXTBody($parts[2]);
             $mime->setHTMLBody($htmlbody);
 //            var_dump($mime);exit;