public void LoadSettingsFromDatabase()
        {
            CriticalResultsEntityManager manager = new CriticalResultsEntityManager();
            SettingEntity[] settings = manager.GetSettings("System");

            string host = null;
            int port = 587;

            string userName = "";
            string password = "";
            string domain = "";
            bool useSsl = false;
            string fromAddress = null;
            string fromName = "Critical Results";

            foreach (SettingEntity setting in settings)
            {
                switch (setting.EntryKey)
                {
                    case "SMTP_AccountName":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            userName = setting.Value;
                        }
                        break;
                    case "SMTP_AccountPassword":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            password = setting.Value;
                        }
                        break;
                    case "SMTP_AccountDomain":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            domain = setting.Value;
                        }
                        break;
                    case "SMTP_UseSSL":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            bool.TryParse(setting.Value, out useSsl);
                        }
                        break;
                    case "SMTP_ServerIP":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            host = setting.Value;
                        }
                        break;
                    case "SMTP_ServerPort":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            port = Int32.Parse(setting.Value);
                        }
                        break;
                    case "SMTP_FromAddress":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            fromAddress = setting.Value;
                        }
                        break;
                    case "SMTP_FromName":
                        if (!String.IsNullOrEmpty(setting.Value))
                        {
                            fromName = setting.Value;
                        }
                        break;
                }
            }
                //_Mailer = new SimpleEmailer(host, port, userName, password, domain, useSsl, fromAddress, fromName);
            _Mailer = new SimpleEmailer(host, port, userName, password, domain, useSsl, fromAddress, fromName);
        }