added sending mail functionality