email functionality working