add mail and remain time utils function