Added mail error reporting functionality. Though not sure if it really works.