Abstracted email code to a seperate class