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

80酷酷网    80kuku.com

  asp3dim 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 & "
"
                    Case "responsecode"
                        emaildata = emaildata & "Code: " & occ.text & "
"
                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

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: