DataObjects/Core_notify_recur.php
[Pman.Core] / NotifySend.php
index 7b91d2e..7dec78a 100644 (file)
@@ -196,7 +196,7 @@ class Pman_Core_NotifySend extends Pman
          
         // this may modify $p->email. (it will not update it though)
         $email =  $this->makeEmail($o, $p, $last, $w, $force);
-        print_R($email);exit;
+        
         if ($email === true)  {
             
             $ev = $this->addEvent('NOTIFY', $w,
@@ -384,10 +384,7 @@ class Pman_Core_NotifySend extends Pman
                 
                 // enable cc in notify..
                 if (!empty($email['headers']['Cc'])) {
-                    $cmailer = Mail::factory('smtp', array(
-                       //'host'    => $dom ,
-                      //  'debug' => true
-                    ));
+                    $cmailer = Mail::factory('smtp',  isset($ff->Mail) ? $ff->Mail : array() );
                     $email['headers']['Subject'] = "(CC): " . $email['headers']['Subject'];
                     $cmailer->send($email['headers']['Cc'],
                                   $email['headers'], $email['body']);
@@ -395,14 +392,15 @@ class Pman_Core_NotifySend extends Pman
                 }
                 
                 if (!empty($email['bcc'])) {
-                    $cmailer = Mail::factory('smtp', array(
-                       //'host'    => $dom ,
-                      //  'debug' => true
-                    ));
+                    $cmailer = Mail::factory('smtp', isset($ff->Mail) ? $ff->Mail : array() );
                     $email['headers']['Subject'] = "(CC): " . $email['headers']['Subject'];
-                    $cmailer->send($email['bcc'],
+                    $res = $cmailer->send($email['bcc'],
                                   $email['headers'], $email['body']);
-                    
+                    if (!$res || is_a($res, 'PEAR_Error')) {
+                        echo "could not send bcc..\n";
+                    } else {
+                        echo "Sent BCC to {$email['bcc']}\n";
+                    }
                 }