Fix email sending issue