Added functionality of sending mail to user and admin