473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Email Validation

Hi, how can I validate the fomat for valid email and the most important is
if that email is real working email...sort of checking mx record? How can i
do this in asp.net

Thanks in advance....

KB
Nov 19 '05 #1
2 1008

"Kiran B." <kb********@yahoo.com> wrote in message
news:eK**************@TK2MSFTNGP12.phx.gbl...
Hi, how can I validate the fomat for valid email and the most important is
if that email is real working email...sort of checking mx record? How can i do this in asp.net

Thanks in advance....

KB

I use the following. I am sure there are other ways but it works for me.
<asp:RegularExpressionValidator id="RequiredEmail1" runat="server"
ControlToValidate="Email1"
InitialValue=""

ValidationExpression="^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|
(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
Display="Static"
Font-Name="verdana" Font-Size="10pt">
* valid e-mail address required
</asp:RegularExpressionValidator>
<asp:CustomValidator id="CustomValidator1" runat="server"
ControlToValidate="Email1"
OnServerValidate="ServerValidate"
Display="Static"
Font-Name="verdana" Font-Size="10pt">
* valid mail server name required.
</asp:CustomValidator>

My code for validating the server name is

Sub ServerValidate (sender As Object, dnsvalue As ServerValidateEventArgs)
dim strDomain as string
dnsvalue.IsValid = False
Try
dim int as int32
int = instr(2,dnsvalue.Value,"@")
strDomain = mid(dnsvalue.value,int+1,999)
If not Dns.GetHostByName(strDomain).hostname is null Then
dnsvalue.IsValid = True
End If
Catch
End Try
RequiredEmail1.text = ""
End Sub
Nov 19 '05 #2
Found this:
http://www.asp.net/ControlGallery/Co...969&tabindex=2
Kiran B. wrote:
Hi, how can I validate the fomat for valid email and the most important is if that email is real working email...sort of checking mx record? How can i do this in asp.net

Thanks in advance....

KB


Daniel M. Hendricks
http://www.danhendricks.com

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Dynamo | last post by:
Hi The following script was taken from John Coggeshall's (PHP consultant) in his article on Zends site at http://www.zend.com/zend/spotlight/ev12apr.php // Get the email address to validate...
2
by: Angel | last post by:
Hi there, I need help pls..I'm using c# on a webform and I have this regex validation for email addresses: ValidationExpression ="\w+(\w+)*@\w+(\w+)*\.\w+(\w+)* " I'm having isssues when submit...
4
by: VbUser25 | last post by:
Hi Please suggest i think i am doing something wrong. I am calling fucntion test from another function where i am performing all the validations.I want to validate the email id. this is the...
2
by: Tim Mills | last post by:
The following code asks the user to sumbit a name, email address, and some text for a quotation via a FORM. I have written a javascript function to evaluate the fields in the form and pop-up a...
35
by: Mika M | last post by:
Simple question: Does Framework (1.1) contain any routine to check entered email-address is valid ? It's quite easy to make own code for that purpose, but why to do if Framework (1.1) contain...
7
by: e_matthes | last post by:
Hello everyone, I've read enough about email validation to know that the only real validation is having a user respond to a confirmation message you've sent them. However, I want to store the...
10
by: ll | last post by:
Hi, I currently am using the following regex in js for email validation, in which the email addresses can be separated by commas or semicolons. The problem, however, lies in that I can type two...
11
by: Bob Bedford | last post by:
Hi all, we have many people that have registered to our newsletter and we are getting every time more people who the email is unavailable. It's there any technique to detect such unavailable...
3
Maidenz08
by: Maidenz08 | last post by:
How do i check whether an email id exists or not? I am following a three step validation process.. 1) syntax validation- which is pretty straight forward 2) DNS validation - I'm able to do...
1
by: shwethatj | last post by:
My problem is lik this , I am trying to create a registration form using javascript for a HR website , but i dont know how to provide password validation i.e the password and confirmation password...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.