Mailer.php
[Pman.Core] / Mailer.php
index 3588ee4..24a9a70 100644 (file)
@@ -386,6 +386,30 @@ class Pman_Core_Mailer {
         @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
         $imgs= $dom->getElementsByTagName('img');
         
+        $urls = array();
+        
+        foreach ($imgs as $i=>$img) {
+            $url  = $img->getAttribute('src');
+            if (preg_match('#^cid:#', $url)) {
+                continue;
+            }
+            $me = $img->getAttribute('mailembed');
+            if ($me == 'no') {
+                continue;
+            }
+            
+            if(!array_key_exists($url, $urls)){
+                $conv = $this->fetchImage($url);
+                $this->images[$conv['contentid']] = $conv;
+            } else {
+                $conv = $urls[$url];
+            }
+            
+            
+        }
+        
+        print_R($test);exit;
+        
         foreach ($imgs as $i=>$img) {
             $url  = $img->getAttribute('src');
             if (preg_match('#^cid:#', $url)) {