Mailer.php
authoredward <edward@roojs.com>
Mon, 26 Mar 2018 06:17:57 +0000 (14:17 +0800)
committeredward <edward@roojs.com>
Mon, 26 Mar 2018 06:17:57 +0000 (14:17 +0800)
Mailer.php

index ca3160d..92f8b5c 100644 (file)
@@ -459,7 +459,14 @@ class Pman_Core_Mailer {
         
         @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
         
-        $body = $dom->getElementsByTagName('body');
+        $html = $dom->getElementsByTagName('html');
+        
+        $head = $dom->getElementsByTagName('head');
+        
+        if(!$head->length){
+            $head = $dom->createElement('head');
+            $html->item(0)->appendChild($head);
+        }
         
         $s = $dom->createElement('style');
         $e = $dom->createTextNode($this->css_inline);