Fix email server issue

Due to incomplete mail library, we got a lot of exceptions these days and users could not reset their password by email.