Send mail refactoring