without using asp validator and javascript validation.
i want validate the email is it valid or not in C#?
Pure email validation in c#? (no javascript and asp validator)
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Satyapriya NayakRank #47 · 31.5K reputationPosted Jun 18, 2012, 11:04 PM EDT
Try this...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Email_validation._Default" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text.RegularExpressions;
namespace Email_validation
{
public partial class _Default : System.Web.UI.Page
{
private void ValidateEmail()
{
string email = txtemail.Text;
Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
Match match = regex.Match(email);
if (match.Success)
Response.Write(email + " is Valid");
else
Response.Write(email + " is inValid");
}
protected void Validate_Click(object sender, EventArgs e)
{
ValidateEmail();
}
}
}
Thanks
If this post helps you mark it as answer