My custom Codeigniter base with PHPMailer, Error reporting via e-mails and a little tweaked Template engine.
Main site setup happens here. Rename .htaccess.sample to .htaccess. It is added to .gitignore not to override it after pushing to server. Configure ENVIRONMENT, SITE_NAME (used for error reporting to identify the site) and DATABASE details here. And thats it! You don't have to change any other configs.
A helper for reporting errors while they happen to specified e-mail address.
Files used: application/helpers/err_helper.php application/config/err.php
// Should errors not be displayed for the user.
define('ERR_SILENT', FALSE);
// E-mail recipient.
define('ERR_MAIL_TO', 'webmaster@domain.com');
define('ERR_MAIL_TO_NAME', 'Webmaster');
// E-mail from.
define('ERR_MAIL_FROM', 'webmaster@domain.com');
define('ERR_MAIL_FROM_NAME', strtoupper(ENVIRONMENT) . ' Error Daemon');
// E-mail subject
define('ERR_MAIL_SUBJECT', SITE_NAME . ': [TYPE] @ [BASENAME]:[LINE]');
// SMTP, or MAIL otherwise
define('ERR_MAIL_METHOD', 'MAIL');
// SMTP details.
define('SMTP_HOST', 'localhost');
define('SMTP_USER', 'g4send');
define('SMTP_PASS', 's3ndm41l');
define('SMTP_PORT', 25);
// What information should be also attached to error e-mails.
define('ERR_MAIL_FOOTERS', 'POST,GET,SESSION');
Sending e-mails requires PHPMailer library which is supplied in this folder: application/libraries/PHPMailer