当前位置:编程学习 > C#/ASP.NET >>

asp.net如何通过邮箱地址获取该邮箱的pop3f服务器和smtp服务器

比如知道邮箱名是aaa@163.com  就凭这个邮箱名作为参数获取163邮箱的pop3服务器和smtp服务器?? --------------------编程问答-------------------- 自己判断,截取@后和.前面的  判断所属服务器 --------------------编程问答--------------------

 Regex reg = new Regex(@"@([^\.]*?)\.");
            Match m = reg.Match(account);
            string mail = null;
            if (m.Success)
            {
                 mail = m.Result("$1");
            }
            if (mail.Equals("qq"))
            {
                pop3Server = "pop.qq.com";
            }
            if (mail.Equals("163"))
            {
                pop3Server = "pop.163.com";
            }
            if (mail.Equals("sohu"))
            {
                pop3Server = "pop.sohu.com";
            }
            if (mail.Equals("sina"))
            {
                pop3Server = "pop.sina.com";
            }
            if (mail.Equals("scfashion"))
            {
                pop3Server = "mail.scfashion.com";
            }
            port = 110;
            useSSL = false;
            //连接POP3服务器
            try
            {
               //连接
            }
            catch (Exception e)
            {
               
               Response.Write("<script>alert('发生错误,请检查邮箱名及密码,或与系统管理员联系!');window.location='error.htm'</script>");
            }           
--------------------编程问答-------------------- 好像很难的,现在的防火墙技术不断更新,估计只能手工添加字典吧
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,