void FillSettings() { dbHelper helper = new dbHelper(); var EmailSendInterval = helper.GetSettingFromKey("EmailSendInterval", "10"); var EmailForBulk = helper.GetSettingFromKey("EmailForBulk", "50"); var SMTPUserName = helper.GetSettingFromKey("SMTPUserName", ""); var SMTPPassword = helper.GetSettingFromKey("SMTPPassword", ""); var SMTPHostName = helper.GetSettingFromKey("SMTPHostName", ""); var SMTPHostPort = helper.GetSettingFromKey("SMTPHostPort", ""); var EnableSSL = helper.GetSettingFromKey("EnableSSL", "true"); var LastRunTime = helper.GetSettingFromKey("LastRunTime", ""); var ReTryTime = helper.GetSettingFromKey("ReTryTime", "5"); var UseDefaultCredentials = helper.GetSettingFromKey("UseDefaultCredentials", "false"); var ThreadCount = helper.GetSettingFromKey("ThreadCount", "1"); if (ReTryTime != "" && EmailSendInterval != "" && EmailForBulk != "" && SMTPUserName != "" && SMTPPassword != "" && SMTPHostName != "" && SMTPHostPort != "" && EnableSSL != "" && UseDefaultCredentials != "" && ThreadCount != "") { settings = new Dictionary <string, string>(); settings.Add("EmailSendInterval", EmailSendInterval); settings.Add("EmailForBulk", EmailForBulk); settings.Add("SMTPUserName", SMTPUserName); settings.Add("SMTPPassword", SMTPPassword); settings.Add("SMTPHostName", SMTPHostName); settings.Add("SMTPHostPort", SMTPHostPort); settings.Add("EnableSSL", EnableSSL); settings.Add("LastRunTime", LastRunTime); settings.Add("ReTryTime", ReTryTime); settings.Add("ThreadCount", ThreadCount); settings.Add("UseDefaultCredentials", UseDefaultCredentials); } else { logHelper.LogException(new Exception("Settings are invalid"), main_path); } }