working version of email sending