Fix handle unknown error in MailTransport

Fix handle unknown error in MailTransport. Fixes #3859