refactored + done base for sending email