First add a service reference to the project
---------------------------Verify that the Email address is correct. aspx-----------------
Copy Code code as follows:
<title></title>
<body>
<form id= "Form1" runat= "Server" >
<asp:scriptmanager id= "ScriptManager1" runat= "Server" >
</asp:ScriptManager>
<asp:updatepanel id= "UpdatePanel1" runat= "Server" >
<ContentTemplate>
<div>
Email<asp:textbox id= "Txtemail" runat= "Server" ></asp:textbox><asp:label id= "Lblinfo"
runat= "Server" text= "></asp:Label>
<br/>
<br/>
<asp:button id= "Button1" runat= "Server" text= "Call onclick=" Button1_Click "/>"
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
--------------------Verify that the Email address is correct. Aspx.cs-----------------------
Copy Code code as follows:
protected void Button1_Click (object sender, EventArgs e)
{
Webemail.validateemailwebservice webemail = new Webemail.validateemailwebservice ();
byte result = Webemail. Validateemailaddress (Txtemail. Text);
if (result = = 0)
{
Lblinfo. Text = "Please verify again";
}
else if (result = = 1)
{
Lblinfo. Text = "email address valid";
}
else if (result = = 2)
{
Lblinfo. Text = "Only the domain name is correct";
}
else if (result = = 3)
{
Lblinfo. Text = "An unknown error";
}
else if (result = = 4)
{
Lblinfo. Text = "Mail server not found";
}
else if (result = = 5)
{
Lblinfo. Text = "e-mail address error";
}
else if (result = = 6)
{
Lblinfo. Text = "Free user authentication exceeds quantity (50 times/24 hours)";
}
else if (result = = 7)
{
Lblinfo. Text = "Business User cannot pass validation";
}
}