refactor to send_mail function, add modern_delete_mail function