From 5ea27d5ff3f26475d766635e650c0cd0fd163cf3 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 10 Sep 2008 16:42:22 +0000 Subject: use it::mail for (hopefully) correct encoding --- it.class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'it.class') 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 "
{$p['title']}\n".rtrim($body).""; -- cgit v1.2.3