Correctly call mailers error_handler. refs #1365
Merge branch 'master' into bug1365
Add tests for the error handler on mailers

Also made BaseMailer#error_handler public, since it can be called from the
outside.

refs #1365
Merge pull request #46 from mconf/bug1365

Correctly call mailers error_handler. refs #1365