Improved mailer plugin error handling