Exemplo n.º 1
0
        static void Connect(string username, string password)
        {
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                Log.Error(MissingCredentialsMessage);
                return;
            }

            try {
                client = new GMailClient(username, password);
            } catch (Exception) {
                Log.Error(ConnectionErrorMessage);
            }
        }
Exemplo n.º 2
0
        public static bool TryConnect(string username, string password)
        {
            GMailClient test;

            try {
                test = new GMailClient(username, password);
                test.UpdateContacts();
                Connect(username, password);
            } catch (Exception) {
                Log.Error(ConnectionErrorMessage);
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
 static GMail()
 {
     Preferences = new GMailPreferences();
     client      = new GMailClient(Preferences.Username, Preferences.Password);
 }