added email task code. not tested, just for future dev.