Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verify that email domain exists

Tags:

c#

asp.net

smtp

Does anyone check the domain of an email address as part of their verification steps? eg. Confirm that gmail.com exists if the user specified [email protected] as their address.


I should note that in my webapp an existing user can forward invites to their friends. I have no need to verify those invites at all. Rather, I just want to warn my user if a typo etc. may be sending an invite to the wrong person. Is this even worthwhile to do?

like image 952
Testing123 Avatar asked Jun 14 '10 19:06

Testing123


1 Answers

The websites that need to validate the user email address usually send an email to that address with a validation link. Checking the domain for the email does not buy you much, since people usually give fake emails on an existing web email provider (usually @gmail.com, @yahoo.com or @hotmail.com)

If you want to still validate the domain, you should do a DNS check for an MX record for that domain, instead of just checking if the domain is registered.

Update: Note that the domain part of an email can actually be an IP address (even though this form is strongly discouraged). In this case, you can't verify reliably if there is an SMTP server at that address, unless you actually attempt to connect to it over SMTP. Which is essentially the same as sending an email.

like image 148
Franci Penov Avatar answered Oct 14 '22 00:10

Franci Penov