I want to create a web application using any technology that accepts an email address and checks if the domain of the email address exists. How do I go about doing this?
Asked
Active
Viewed 2,236 times
1 Answers
1
here is the C# code to check domain from email Id
var domain = emailaddress.Split('@')[1];
var server = Dns.Resolve(domain);

Christian Hayter
- 30,581
- 6
- 72
- 99

Madhu Beela
- 2,205
- 16
- 16
-
What i thought of doing is create a aspx page with the textbox, label and a button. On the click of the button the email address have to be checked. this I thought could be done with an if statement. and if the domain exists an alert would be displayed. Is my idea right? Can we do it this way? if yes, how do we split the address and execute the if statement?? Plz advice. – user1213555 Feb 16 '12 at 10:53
-
Thanks madhu, but how could we split the array? The if statement would resemble something like if(username.text=________) then alert('domain name valid') else alert('domain name invalid') – user1213555 Feb 16 '12 at 11:08
-
may be link below will be useful for u http://stackoverflow.com/questions/5873118/checking-if-an-email-address-exists – Madhu Beela Feb 16 '12 at 11:18