Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType(), Page);
            Page.RegisterBodyScripts("~/usercontrols/management/MailService/js/mailservice.js");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "mailservice_style", "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + WebPath.GetPath("usercontrols/management/mailservice/css/mailservice.css") + "\">", false);

            var mailServerInfo = MailServiceHelper.GetMailServerInfo();

            if (mailServerInfo == null)
            {
                ServerIp = string.Empty;
                User     = DefaultUser;
                Password = DefaultPassword;
            }
            else
            {
                ServerIp = mailServerInfo.Api.Server;

                var connectionParts = mailServerInfo.DbConnection.Split(';');

                foreach (var connectionPart in connectionParts)
                {
                    if (connectionPart.StartsWith("User ID="))
                    {
                        User = connectionPart.Replace("User ID=", "");
                    }

                    if (connectionPart.StartsWith("Password="******"Password="******"");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType(), Page);
            Page.RegisterBodyScripts("~/UserControls/Management/MailService/js/mailservice.js");
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "mailservice_style", "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + WebPath.GetPath("UserControls/Management/MailService/css/mailservice.css") + "\">", false);

            var mailServerInfo = CoreContext.Configuration.Standalone ? MailServiceHelper.GetMailServerInfo() : null;

            if (mailServerInfo == null)
            {
                SqlHost  = string.Empty;
                ApiHost  = string.Empty;
                Database = MailServiceHelper.DefaultDatabase;
                User     = MailServiceHelper.DefaultUser;
                Password = MailServiceHelper.DefaultPassword;
            }
            else
            {
                ApiHost = mailServerInfo.Api.Server;

                var connectionParts = mailServerInfo.DbConnection.Split(';');

                foreach (var connectionPart in connectionParts)
                {
                    if (connectionPart.StartsWith("Server="))
                    {
                        SqlHost = connectionPart.Replace("Server=", "");
                    }

                    if (connectionPart.StartsWith("Database="))
                    {
                        Database = connectionPart.Replace("Database=", "");
                    }

                    if (connectionPart.StartsWith("User ID="))
                    {
                        User = connectionPart.Replace("User ID=", "");
                    }

                    if (connectionPart.StartsWith("Password="******"Password="******"");
                    }
                }
            }

            HelpLink = CommonLinkUtility.GetHelpLink();
        }
Ejemplo n.º 3
0
 public object GetMailServerInfo()
 {
     return(MailServiceHelper.GetMailServerInfo());
 }