首页 > 编程 > ASP > 正文

精品:Asp3.0中email有效性验证

2024-05-04 11:06:29
字体:
来源:转载
供稿:网友
dim email
dim status
dim emaildata
dim licensekey

licensekey = 0
if request.form.count > 0 then
        email = request.form("email")
    
          dim oxmlhttp      
      
      set oxmlhttp = server.createobject("msxml2.serverxmlhttp")

      oxmlhttp.open "post", _
                    "http://ws.cdyne.com/emailverify/ev.asmx/verifyemail", _
                    false
      oxmlhttp.setrequestheader "content-type", _
                                "application/x-www-form-urlencoded"
      oxmlhttp.send "email=" & server.urlencode(email) & "&licensekey=" & server.urlencode(licensekey)
      response.write oxmlhttp.status
      if oxmlhttp.status = 200 then
          dim odom
          set odom = oxmlhttp.responsexml
          dim onl
          dim ocn
          dim occ
          set onl = odom.getelementsbytagname("returnindicator")
          for each ocn in onl
            for each occ in ocn.childnodes
                select case lcase(occ.nodename)
                    case "responsetext"
                        emaildata = emaildata & "codetxt: " & occ.text & "<br>"
                    case "responsecode"
                        emaildata = emaildata & "code: " & occ.text & "<br>"
                end select
            next
          next
          if status = "" then status = "ok"

          set occ = nothing
          set ocn = nothing
          set onl = nothing
          set odom = nothing
          
          
          
      
      else
        status = "service unavailable. try again later"
      end if
      set oxmlhttp = nothing
    
end if

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表