refactored mail sent