sends an email when the session is ended