user1213555
user1213555

Reputation: 17

Validating email address domain in ASP.NET

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?

Upvotes: 1

Views: 2268

Answers (1)

Madhu Beela
Madhu Beela

Reputation: 2215

here is the C# code to check domain from email Id

var domain = emailaddress.Split('@')[1];
var server = Dns.Resolve(domain);

Upvotes: 1

Related Questions