working on email send function