private void Logout() { GXLogging.Debug(log, "Logging out"); if (loggedIn) { try { readItems = null; session.Logoff(); loggedIn = false; } catch (Exception exc) { GXLogging.Error(log, "Error Logging out", exc); } } else { GXLogging.Error(log, "Not logged in"); throw new GXMailException("Not logged in", 2); } }