send email functionality working