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); } }
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); }
static GMail() { Preferences = new GMailPreferences(); client = new GMailClient(Preferences.Username, Preferences.Password); }