views:

622

answers:

8

Hiya. when people register to my website i don't want to send them a verification e-mail, i just want to check if that e-mail exists. is there a way to do such a thing ?

using apache-tomcat and java as my main programming language.

thanks a lot!

+14  A: 

No. There is no way to tell if an email address points to a valid destination. You can check basic syntax, and that the domain has a record in DNS, but that's all.

bmargulies
More specifically: "...has a **MX** record in DNS..."
Dolph
I don't agree. You can deliver email to a domain with no MX record.
bmargulies
@bmargulies: how would you do that?
Joachim Sauer
this isn't actually the correct answer
fuzzy lollipop
A host can perfectly well run an SMTP server on port 25 without any MX records. MX records exist to tell you that mail addressed to some DNS name should be delivered to some other domain. If foo.bar.baz.com has an SMTP server, it needs no MX records to accept mail.
bmargulies
+5  A: 

You can at highest use regex to check if the address is syntactically valid and/or looking up the MX records if the domain is valid, but this still does not guarantee that the email address is legitimate and belongs to the registrant in question. There is really no more reliable way than sending a verficiation email and waiting for confirmation in a short timespan.

BalusC
this isn't the 100% correct answer
fuzzy lollipop
@fuzzy: There's also not an 100% reliable way that the email address belongs to the user in question and this is never going to come. I checked the site in your answer, entered several addresses I know they exist and some of them failed because the server doesn't support VRFY. I wouldn't waste that much time verifying the email address somewhere else on the network. Just send a verification email and wait for confirmation :)
BalusC
you can connect send a RCPT message and then RSET it, you didn't look at what my solution actually does.
fuzzy lollipop
OK, so be it then, thanks for the attitude.
BalusC
+1  A: 

If you just want to verify that it LOOKs like a valid email address, there are many sample Regex's that will verify that. If you want to verify the user has control of the email address, you'll need to send something to it and craft a unique response to verify it.

No Refunds No Returns
+3  A: 

This has been answered already in previous questions here. Without a verification email, the best you can do is look at the email address and look if it seems valid. You can also check things such as the domain, to see if it exists and has MX records. Anyway, see http://stackoverflow.com/questions/3232/how-far-should-one-take-e-mail-address-validation and http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses

Mike
+1  A: 

i guess this is what you are looking for

http://www.strikeiron.com/Catalog/ProductDetail.aspx?pv=5.0.0&pn=Email+Verification

Anantha Kumaran
looks like a great service but i would prefer something free of charge. thanks
ufk
+2  A: 

contrary to some of the uneducated answers you can TRY and connect to an MX server and use the VRFY command to see if the sever supports it. Here is a website that will do this for you as an example. If you look at its exchange with the MX server it actually does try and send an email but does a RESET before actually sending it. Testing it with my email address works but I don't get an email. So yes you CAN do what everyone else is saying you can't do. Use an address you know works for your domain, then use one that you don't isn't supported. You will get a 550 on the last RCTP TO command. That is how you know it doesn't exist.

fuzzy lollipop
+3  A: 

I just wanted to weigh in and say that despite your reticence to do so, PLEASE send an email and force the user to confirm that they have control of it before allowing that email address to be used in association with an account on your site. Why? Because not doing that, for any reason, means that users can sign up for accounts using email addresses that aren't theirs. They might do so accidentally, or they might do so very much on purpose (e.g., signing others up for accounts for any number of reasons); that's just not kosher, and websites that allow it are open to being reported to their ISPs.

(I say this as the owner of a Gmail account which, at least two to three times a month, is signed up for an account at some website that doesn't force users to confirm their email addresses in this manner. It's irritating, and it puts the onus on me to get the account removed from the offending website. I've now taken to recovering any passwords I can, logging into the account, and then changing the email address to "[email protected]" or something like that... it's sorta fun, but I doubt you want this to happen on your website.)

delfuego
The important point here is not so much "force people to confirm an email address" but "don't send email to unconfirmed addresses". You can create accounts before the email is confirmed, provide you don't send any emails (other than the confirmation attempt) or prevent other users attempting to confirm that address.
Colin Pickard
thanks for the information guys :)
ufk
+1  A: 

You can use the openid service to check for valids email addresses as stackoverflow does.

http://openid.net/

Koder_