diff options
author | Urban Müller | 2008-09-10 16:42:22 +0000 |
---|---|---|
committer | Urban Müller | 2008-09-10 16:42:22 +0000 |
commit | 5ea27d5ff3f26475d766635e650c0cd0fd163cf3 (patch) | |
tree | acf4a584943016f0c10876aef2c1b22ed979c36e /it.class | |
parent | e9afef9e72cbb962f8f48c2effdd415e4777153e (diff) | |
download | itools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.tar.gz itools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.tar.bz2 itools-5ea27d5ff3f26475d766635e650c0cd0fd163cf3.zip |
use it::mail for (hopefully) correct encoding
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>"; |