Fixed a bug in the email 'mail' service error handling.