mirror of
https://github.com/e107inc/e107.git
synced 2025-07-16 12:36:26 +02:00
Issue #4986 Added option to send an email when a critical error occurs. (one email per day)
Usage: Add the following to e107_config.php, replacing the email address with your own. define('e_EMAIL_CRITICAL', 'myemail@somewhere.com');
This commit is contained in:
@ -1127,6 +1127,21 @@ $SYSTEM_DIRECTORY = "e107_system/";</pre>
|
|||||||
$file = null;
|
$file = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(defined('e_EMAIL_CRITICAL'))
|
||||||
|
{
|
||||||
|
$date = date('r');
|
||||||
|
$subject = '['. $_SERVER['HTTP_HOST'].'] Critical Error';
|
||||||
|
$emailLogFile = e_LOG.'criticalErrorEmail'.date('Ymd').'.log';
|
||||||
|
if(!file_exists($emailLogFile))
|
||||||
|
{
|
||||||
|
@mail(e_EMAIL_CRITICAL, $subject, $date."\t\t". strip_tags($message));
|
||||||
|
@file_put_contents(e_LOG.'criticalErrorEmail'.date('Ymd').'.log', 'Critical Error email sent to '.e_EMAIL_CRITICAL);
|
||||||
|
}
|
||||||
|
$message = LAN_ERROR_11; // "Check log for details";
|
||||||
|
$line = null;
|
||||||
|
$file = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!defined('HEADERF'))
|
if(!defined('HEADERF'))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user