</pre>');
} elseif (($isHtml == 'Y') && (isExtensionActive('html_mail'))) {
// Send mail as HTML away
- sendHtmlEmail($toEmail, $subject, $message, $mailHeader);
+ return sendHtmlEmail($toEmail, $subject, $message, $mailHeader);
} elseif (!empty($toEmail)) {
// Send Mail away
- sendRawEmail($toEmail, $subject, $message, $mailHeader);
+ return sendRawEmail($toEmail, $subject, $message, $mailHeader);
} elseif ($isHtml != 'Y') {
// Problem found!
- sendRawEmail(getConfig('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
+ return sendRawEmail(getConfig('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
}
}
$mail->AddCustomHeader('Errors-To:' . getConfig('WEBMASTER'));
$mail->AddCustomHeader('X-Loop:' . getConfig('WEBMASTER'));
$mail->Send();
+
+ // Has an error occured?
+ if (!empty($mail->ErrorInfo)) {
+ // Log message
+ logDebugMessage(__FUNCTION__, __LINE__, 'Error while sending mail: ' . $mail->ErrorInfo);
+
+ // Raise an error
+ return false;
+ } else {
+ // All fine!
+ return true;
+ }
} else {
// Use legacy mail() command
- mail($toEmail, $subject, decodeEntities($message), $from);
+ return mail($toEmail, $subject, decodeEntities($message), $from);
}
}
// Loads the snippet for the uberwach action
function loadUberwachSnippet () {
// Simply load the template here
- $GLOBALS['page_footer'] .= loadTemplate('uberwach_snippet', true, $content);
+ $GLOBALS['page_footer'] .= loadTemplate('uberwach_snippet', true);
}
// Filter for displaying uberwach snippet