DataObjects/Core_notify_recur.php
[Pman.Core] / Mailer.php
index 3eff01f..e8903a8 100644 (file)
@@ -75,6 +75,8 @@ class Pman_Core_Mailer {
     var $mail_method = 'SMTP';
     
     var $cache_images = true;
+      
+    var $bcc = false;
     
     function Pman_Core_Mailer($args) {
         foreach($args as $k=>$v) {
@@ -87,8 +89,8 @@ class Pman_Core_Mailer {
         if (!empty($ff->Core_Mailer['debug'])) {
             $this->debug = $ff->Core_Mailer['debug'];
         }
-        $this->log("URL MAP");
-        $this->log($this->urlmap);
+        //$this->log("URL MAP");
+        //$this->log($this->urlmap);
         
     }
      
@@ -280,8 +282,11 @@ class Pman_Core_Mailer {
             'body' => $parts[2],
             'mailer' => $this
         );
-        if (isset($))
-        return $ret;;
+        // add bcc if necessary..
+        if (!empty($this->bcc)) {
+           $ret['bcc'] = $this->bcc;
+        }
+        return $ret;
     }
     function send($email = false)
     {
@@ -397,7 +402,7 @@ class Pman_Core_Mailer {
                 $file = $ff->rootDir . $url;
 
                 if (!file_exists($file)) {
-                    echo $file;
+//                    echo $file;
                     $link->setAttribute('href', 'missing:' . $file);
                     continue;
                 }
@@ -437,7 +442,7 @@ class Pman_Core_Mailer {
             return array(
                     'mimetype' => $mt,
                    'ext' => $ext,
-                   'contentid' => md5($file),
+                   'contentid' => md5($file),  // mailer makes md5 cid's' -- cid with attachment-** are done by mailer.
                    'file' => $file
             );
             
@@ -529,6 +534,8 @@ class Pman_Core_Mailer {
          
         
     }
+    
     
     function log($val)
     {
@@ -536,7 +543,7 @@ class Pman_Core_Mailer {
             return;
         }
         if ($this->debug < 2) {
-            echo '<PRE>' . $val. "\n";
+            echo '<PRE>' . print_r($val,true). "\n"; 
             return;
         }
         $fh = fopen('/tmp/core_mailer.log', 'a');