Refactored email sender