diff --git a/e107_handlers/message_handler.php b/e107_handlers/message_handler.php index a38be3cce..3a626fba0 100644 --- a/e107_handlers/message_handler.php +++ b/e107_handlers/message_handler.php @@ -1127,6 +1127,21 @@ $SYSTEM_DIRECTORY = "e107_system/"; $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')) {