fixed mail sending bug