summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2008-09-10 16:42:22 +0000
committerUrban Müller2008-09-10 16:42:22 +0000
commit5ea27d5ff3f26475d766635e650c0cd0fd163cf3 (patch)
treeacf4a584943016f0c10876aef2c1b22ed979c36e
parente9afef9e72cbb962f8f48c2effdd415e4777153e (diff)
downloaditools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.tar.gz
itools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.tar.bz2
itools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.zip
use it::mail for (hopefully) correct encoding
-rw-r--r--it.class3
1 files changed, 2 insertions, 1 deletions
diff --git a/it.class b/it.class
index d64559c..57ae3ae 100644
--- a/it.class
+++ b/it.class
@@ -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>";