diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -171,6 +171,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate { $lastsentfn = "/tmp/alertdata/lastsent_" . getmyuid() . "." . md5($p['to']); $now = time(); + clearstatcache(); $lastsenttime = @filemtime($lastsentfn); $sendmail = $now - $lastsenttime > $p['blockmail']; $lastsentdebug = "Lastsent: lastsentfn=$lastsentfn now=$now lastsenttime=$lastsenttime blockmail={$p['blockmail']} sendmail=$sendmail\n\n"; @@ -209,7 +210,7 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate $body .= $fulltrace ? "Stack: " . print_r($fulltrace, true) . "\n\n" : ""; $body = it::replace(array('(pw|passw|password|secret)\] => .*' => '$1] => ********'), $body); - mail($p['to'], $p['title'], $body, ($cc = $GLOBALS['it_defaultconfig']['error_cc']) ? "Cc: $cc" : null); + it::mail(array('To' => $p['to'], 'Subject' => $p['title'], 'Body' => $body) + (($cc = $GLOBALS['it_defaultconfig']['error_cc']) ? array('Cc' => $cc) : array())); } else if ($_SERVER['REMOTE_ADDR']) # toscreen mode: web echo "<pre>{$p['title']}\n".rtrim($body)."</pre>"; |