DataObjects/ProjectDirectory.php
[Pman.Core] / NotifySend.php
index 467cf1d..9c6cd02 100644 (file)
@@ -77,7 +77,7 @@ class Pman_Core_NotifySend extends Pman
     function get($id,$opts)
     {
         if ($opts['DB_DataObject-debug']) {
-            DB_DataObject::debugLevel($opts['debug']);
+            DB_DataObject::debugLevel($opts['DB_DataObject-debug']);
         }
         //DB_DataObject::debugLevel(1);
         //date_default_timezone_set('UTC');
@@ -146,8 +146,7 @@ class Pman_Core_NotifySend extends Pman
                      "Notification event cleared (not required any more)" 
                     ."\n");
         }
-        
-        
+     
         
         if ($email === false || isset($email['error'])) {
             // object returned 'false' - it does not know how to send it..
@@ -163,6 +162,12 @@ class Pman_Core_NotifySend extends Pman
                             $email['error'] : "INTERNAL ERROR  - We can not handle " . $w->ontable)
                     ."\n");
         }
+        if (isset($email['later'])) {
+            $old = clone($w);
+            $w->act_when = $email['later'];
+            $w->update($old);
+            die(date('Y-m-d h:i:s ') . " Delivery postponed by email creator");
+        }
         
          
         if (!isset($email['headers']['Message-Id'])) {
@@ -178,6 +183,7 @@ class Pman_Core_NotifySend extends Pman
             $p->email = $opts['send-to'];
         }
         
+        $ff = HTML_FlexyFramework::get();
         
         $dom = array_pop(explode('@', $p->email));
         
@@ -188,7 +194,14 @@ class Pman_Core_NotifySend extends Pman
         require_once 'Mail.php';
         
         foreach($mxs as $dom) {
-            $this->debug("Trying SMTP: $dom");
+            
+            
+            
+            if (!isset($ff->Mail['helo'])) {
+                die("config Mail[helo] is not set");
+            }
+            
+            $this->debug("Trying SMTP: $dom / HELO {$ff->Mail['helo']}");
             $mailer = Mail::factory('smtp', array(
                     'host'    => $dom ,
                     'localhost' => $ff->Mail['helo'],