implemented mail sender functionality