Ejemplo n.º 1
0
 private void chkBoxAdvancedSetting_CheckedChanged(object sender, EventArgs e)
 {
     if (chkBoxAdvancedSetting.Checked)
     {
         FormServerSetting fss = new FormServerSetting();
         fss.ShowDialog();
         //
         kindlepushsmtphost = Properties.Settings.Default.KindlePushSmtpServer;
         int port = 25;
         int.TryParse(Properties.Settings.Default.KindlePushSmtpServerPort, out port);
         kindlepushsmtpport = port;
         isUseSSL           = Properties.Settings.Default.KindlePushIsUseSSL;
     }
 }
Ejemplo n.º 2
0
        private void getSmtpHostAndPortByPushMail()
        {
            if (kindlepushemail == "")
            {
                return;
            }

            if (chkBoxAdvancedSetting.Checked)
            {
                return;
            }

            if (kindlepushemail.EndsWith("@outlook.com"))   //OK
            {
                kindlepushsmtphost = "smtp.office365.com";
                kindlepushsmtpport = 587;
                isUseSSL           = true;
            }
            else if (kindlepushemail.EndsWith("@qq.com"))   //OK
            {
                kindlepushsmtphost = "smtp.qq.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@sina.com"))
            {
                kindlepushsmtphost = "smtp.sina.com.cn";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@vip.sina.com"))
            {
                kindlepushsmtphost = "smtp.vip.sina.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@sohu.com"))
            {
                kindlepushsmtphost = "smtp.sohu.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@126.com"))
            {
                kindlepushsmtphost = "smtp.126.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@139.com"))
            {
                kindlepushsmtphost = "smtp.139.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@163.com"))
            {
                kindlepushsmtphost = "smtp.163.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@yahoo.com"))
            {
                kindlepushsmtphost = "smtp.mail.yahoo.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@yahoo.com.cn"))
            {
                kindlepushsmtphost = "smtp.mail.yahoo.com.cn";
                kindlepushsmtpport = 587;
                isUseSSL           = true;
            }
            else if (kindlepushemail.EndsWith("@hotmail.com"))
            {
                kindlepushsmtphost = "smtp.live.com";
                kindlepushsmtpport = 587;
                isUseSSL           = true;
            }
            else if (kindlepushemail.EndsWith("@gmail.com"))
            {
                kindlepushsmtphost = "smtp.gmail.com";
                kindlepushsmtpport = 587;
                isUseSSL           = true;
            }
            else if (kindlepushemail.EndsWith("@263.net"))
            {
                kindlepushsmtphost = "smtp.263.net";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@263.net.cn"))
            {
                kindlepushsmtphost = "smtp.263.net.cn";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@x263.net"))
            {
                kindlepushsmtphost = "smtp.x263.net";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@21cn.com"))
            {
                kindlepushsmtphost = "smtp.21cn.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@foxmail.com"))
            {
                kindlepushsmtphost = "smtp.foxmail.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@china.com"))
            {
                kindlepushsmtphost = "smtp.china.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@tom.com"))
            {
                kindlepushsmtphost = "smtp.tom.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@etang.com"))
            {
                kindlepushsmtphost = "smtp.etang.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@mail.aliyun.com"))
            {
                kindlepushsmtphost = "smtp.aliyun.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else if (kindlepushemail.EndsWith("@elong.com"))
            {
                kindlepushsmtphost = "smtp.elong.com";
                kindlepushsmtpport = 25;
                isUseSSL           = false;
            }
            else
            {
                FormServerSetting fss = new FormServerSetting();
                fss.ShowDialog();

                //kindlepushsmtphost = "smtp.exmail.qq.com"; //OK for @sh-rfid.com
                //kindlepushsmtpport = 587;
                //isUseSSL = true;

                kindlepushsmtphost = Properties.Settings.Default.KindlePushSmtpServer;
                int port = 25;
                int.TryParse(Properties.Settings.Default.KindlePushSmtpServerPort, out port);
                kindlepushsmtpport = port;
                isUseSSL           = Properties.Settings.Default.KindlePushIsUseSSL;
            }
        }