Logic behind email done