fixed the xmail function
improved the current workflow with regard to mailing