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');
"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..
$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'])) {
$p->email = $opts['send-to'];
}
+ $ff = HTML_FlexyFramework::get();
$dom = array_pop(explode('@', $p->email));
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'],
// 'debug' => true
));
$res = $mailer->send($p->email, $email['headers'], $email['body']);
if ($res === true) {
// success....
+ $ev = $this->addEvent('NOTIFY', $w, 'SUCCESS: ' .$email['headers']['Subject']);
+
+
+
$w->sent = date('Y-m-d H:i:s');
$w->msgid = $email['headers']['Message-Id'];
- $w->event_id = -1; // sent ok.. - no need to record it..
+ $w->event_id = $ev->id; // sent ok.. - no need to record it..
$w->update($ww);
// enable cc in notify..