private void FillMailTab()
        {
            if (!serverItem.IsValid)
            {
                MsgBox.Alert("服务器信息配置错误");
                return;
            }
            var checkResult = HttpHelper.CheckHttp(serverItem.HttpUrl);

            if (!checkResult.Item1)
            {
                MsgBox.Alert(checkResult.Item2);
                return;
            }
            var mailInfo = dataSource.GetSmtpMailInfo();

            if (mailInfo == null)
            {
                return;
            }
            Dispatcher.Invoke((Action) delegate() {
                Mail.Text         = mailInfo.Email;
                Password.Password = mailInfo.Password;
                SmtpServer.Text   = mailInfo.SmtpServer;
                if (mailInfo.SmtpPServerPort > 0)
                {
                    SmtpServerPort.Text = mailInfo.SmtpPServerPort.ToString();
                }
                SSL.IsChecked = mailInfo.SSL == 0 ? false : true;
            });
        }
Beispiel #2
0
        private void CheckMailStmpServer()
        {
            var mailInfo = dataSource.GetSmtpMailInfo();

            if (mailInfo == null)
            {
                //服务器还未更新至支持发件箱配置的版本
                return;
            }
            if (!mailInfo.IsValid)
            {
                Dispatcher.Invoke((Action) delegate {
                    var serverProperty   = new ServerProperty(listenServerItem.ID);
                    serverProperty.Owner = this;
                    serverProperty.Show();
                    serverProperty.ShowMailTab();
                });
            }
        }