等待高人:    
    我做了个发邮件的程序,现在想把数据库里取出来的EMAIL验证是否在网络中存在 ,不然发不出去会有很多垃圾邮件啊。    // make sure we use the local SMTP server
    SmtpMail.SmtpServer="";
    // create mail message object
    MailMessage oMessage = new MailMessage();
    // set some properties
    oMessage.BodyFormat = MailFormat.Text;
    oMessage.Priority = MailPriority.High;
    oMessage.From = "[email protected]";
    oMessage.To = dr1["email"].ToString(); //收件人
    if(!System.Text.RegularExpressions.Regex.IsMatch(email,@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"))
            {
                //没有验证成功
            }
这个只是验证EMAIL的格式,但不能验证EMAIL是否在网络中存在嘛 

解决方案 »

  1.   

    可以用现成的webservice(不过一天只能验证十几封),可以满足你的要求
    地址 http://ws.cdyne.com/emailverify/ev.asmx?WSDL
    怎么调用不用我说了吧
      

  2.   

    如果你想自己写的话要熟悉telnet的指令,自己去编程去连接后面的域名服务器判断是否存在。还有一种思路就是写程序分析退信,这个比较效率高
      

  3.   

    if(!System.Text.RegularExpressions.Regex.IsMatch(email,@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"))
                {
                    //没有验证成功
                }