Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How can I check if an email address exists using ASP.NET?

user-image
Question ajoutée par marwa khalaf , .Net Developer , Sands National Academy
Date de publication: 2013/04/09
Zaid Rabab'a
par Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.

In my point of view , i dont think there is a way to do this , maybe a 3rd party service, but even so i dont think all email servers can give you access to these information I think the most succussfull flow to do check email is to send confirmation email, the registration flow not completed until he check his email.

Panneer selvam xavier
par Panneer selvam xavier , Supply Chain Analyst / Trainer , Infonet

E-mail address syntax check.marks invalid addresses such example#yahoo.com, example!@$aol,com etc.
Availability of the domain of e-mail addresses.
Then checks the availability of the domain, i.
e.
it marks valid such addresses example@yahop.com, example@hotmaip.com and marks nonexistent domains as invalid.
Existence of e-mail addresses on their mail servers.
Then tries to establish an SMTP connection with the mail server and tests the addresses.
Port 25 needs to be open for this last step.

You can't.
There used to be a VRFY command in SMTP servers, but not anymore.
Spammers would love such a command, being able to probe mail servers to check for existing users.
You can check the e-mail address is valid though.

In my opinion only thing you can do is ping domain of email (of course you should store results of this ping to speed up later queries).
This will exclude misspelled in this part of address.

Mohammed Sallam
par Mohammed Sallam , Full-stack Software Engineer , Freelancing

For email address syntax you could use the following regular expression script: ^\w+([-+.]*[\w-]+)*@(\w+([-.]?\w+)){1,}\.\w{2,4}$ use Regex object from System.Text.RegularExpressions namespace to do the test like the following: Regex rgx = new Regex(@"^\w+([-+.]*[\w-]+)*@(\w+([-.]?\w+)){1,}\.\w{2,4}$"); if (!rgx.IsMatch("example#yahoo.com")) //cancel operation; And for verifying whether of the email is real or not, there is always the confirmation-email technique as Zaid Rabab'a mentioned.

Hazem Salama
par Hazem Salama , Senior Member of Technical Staff , Verizon Communications

I really don't believe there is any "reliable" way to do this.
Most mail servers would not return any code to you if the address is not valid.
Reason being that you can use the same method for spamming.
So, if you really need to verify the email address, the one sure way is to send an email that contains a hyperlink to that address with a unique ID for example.
If that get clicked then you would have a valid address.
That of course does not stop someone from creating a fake email address to register and then delete it or whatever.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?