// email_to_user is not usable because email_to_user tries to write to the logs table, and this will get caught
// in an infinite loop, if disk is full
- mail($CFG->supportemail, $subject, $message);
+ if (empty($CFG->noemailever)) {
+ mail($CFG->supportemail, $subject, $message);
+ }
}
if (!$result and debugging()) {
echo '</td></tr></table>';
echo '</body></html>';
- if (!empty($CFG->emailconnectionerrorsto)) {
+ if (empty($CFG->noemailever) and !empty($CFG->emailconnectionerrorsto)) {
mail($CFG->emailconnectionerrorsto,
'WARNING: Database connection error: '.$CFG->wwwroot,
'Connection error: '.$CFG->wwwroot);