function get($id,$opts=array())
{
-
+
//print_r($opts);
if (!empty($opts['DB_DataObject-debug'])) {
DB_DataObject::debugLevel($opts['DB_DataObject-debug']);
if (!$w->get($id)) {
$this->errorHandler("invalid id\n");
}
+
if (!$force && strtotime($w->act_when) < strtotime($w->sent)) {
if ($email === false || isset($email['error']) || empty($p)) {
// object returned 'false' - it does not know how to send it..
- $ev = $this->addEvent('NOTIFY', $w, isset($email['error']) ?
+ $ev = $this->addEvent('NOTIFYFAIL', $w, isset($email['error']) ?
$email['error'] : "INTERNAL ERROR - We can not handle " . $w->ontable);
$ww = clone($w);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
require_once 'Validate.php';
if (!Validate::email($p->email, true)) {
- $ev = $this->addEvent('NOTIFY', $w, "INVALID ADDRESS: " . $p->email);
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "INVALID ADDRESS: " . $p->email);
$ww = clone($w);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$this->errorHandler(date('Y-m-d h:i:s') . " - MX LOOKUP FAILED\n");
}
- $ev = $this->addEvent('NOTIFY', $w, "BAD ADDRESS - BAD DOMAIN - ". $p->email );
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "BAD ADDRESS - BAD DOMAIN - ". $p->email );
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
if (!$force && strtotime($w->act_start) < strtotime('NOW - 14 DAY')) {
- $ev = $this->addEvent('NOTIFY', $w, "BAD ADDRESS - GIVE UP - ". $p->email );
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "BAD ADDRESS - GIVE UP - ". $p->email );
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') :$w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
$mailer->host = $server;
- $mailer->auth = true;
- $mailer->username = $settings['username'];;
+ $mailer->auth = isset($settings['auth']) ? $settings['auth'] : true;
+ $mailer->username = $settings['username'];
$mailer->password = $settings['password'];
if (isset($settings['port'])) {
$mailer->port = $settings['port'];
$errmsg= $res->userinfo['smtpcode'] . ':' . $res->userinfo['smtptext'];
}
- $ev = $this->addEvent('NOTIFY', $w, ($fail ? "FAILED - " : "RETRY TIME EXCEEDED - ") .
+ $ev = $this->addEvent('NOTIFYFAIL', $w, ($fail ? "FAILED - " : "RETRY TIME EXCEEDED - ") .
$errmsg);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
// handle no host availalbe forever...
if (strtotime($w->act_start) < strtotime('NOW - 3 DAYS')) {
- $ev = $this->addEvent('NOTIFY', $w, "RETRY TIME EXCEEDED - ". $p->email);
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "RETRY TIME EXCEEDED - ". $p->email);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
{
$this->debug_str .= strlen($this->debug_str) ? "\n" : '';
$this->debug_str .= $message;
+ //echo $message ."\n";
}
function errorHandler($msg, $success = false)