diff options
author | Urban Müller | 2007-10-08 18:50:27 +0000 |
---|---|---|
committer | Urban Müller | 2007-10-08 18:50:27 +0000 |
commit | e1be1a203473712d6437627fb876bc78351b0e8f (patch) | |
tree | 6a4d67c57761f990a90ae7bda06b8c4b2c9a31f5 | |
parent | 66c4a5297dc1be7329d63c0cc5b53a23201d1c4f (diff) | |
download | itools-e1be1a203473712d6437627fb876bc78351b0e8f.tar.gz itools-e1be1a203473712d6437627fb876bc78351b0e8f.tar.bz2 itools-e1be1a203473712d6437627fb876bc78351b0e8f.zip |
use it::mail in it::error
-rw-r--r-- | it.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -198,7 +198,10 @@ function error($p = array(), $body = null, $to = null) # $body and $to deprecate $body .= $trace ? "Stack: " . print_r(debug_backtrace(), true) . "\n\n" : ""; $pwentry = posix_getpwuid(posix_getuid()); - mail($p['to'], $p['title'], $body, "From: " . $pwentry['name'] ? $pwentry['name'] : posix_getuid()); + $from = $pwentry['name'] ? $pwentry['name'] : posix_getuid(); + $mail = new it_mail(array('To' => $p['to'], 'From' => $from, 'Subject' => $p['title'])); + $mail->add_body($body); + $mail->send(); } else if ($_SERVER['REMOTE_ADDR']) # in shell mode we rely on error_log below echo "<pre>{$p['title']}\n$body</pre>"; |