• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to validate email address is valid or fake

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello please help me in this.. 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 ?
i am developing a java web application, i want to check whether the email exist or not when they enter .. how to do that using java?

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. You can check whether an email is syntactically valid, but the email servers for most domains will reject an attempt to check whether any particular email exists. And even if the address exists, it may still be that the account is no longer checked by its user, or doesn't accept mail because it's full, or has been deactivated, or doesn't accept mails from your server because the sending domain/server doesn't validate in some way.

In short: there are any number of reasons why an email might not go through that you can't check without sending an email to that address and have the user act on it.
 
Eshwara Chaluvaiah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
using spring is it possible? i have basic idea of spring but i don't know whether it will support for validating email? please give some suggestion..
Thank you
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, it is not possible, as Ulf said. Doesn't matter if you use Spring or not. It's not a matter of using the right framework or library. It's just not possible in principle.

The whole reason that websites send verification e-mails is because there's no other way to verify if an e-mail address is a real e-mail address that works. And even that isn't fool-proof; people can make temporary e-mail addresses that get deleted after they've answered the verification e-mail. There's just no 100% fool-proof way to check if an e-mail address is valid and real, certainly not if you don't want to send a verification e-mail.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you at least determine that the mail host name is valid?

Perhaps the java.net.InetAddress class getByName( String host ) would work?

I have not tried this but would love to know if it works.

Bill
 
Eshwara Chaluvaiah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no i didn't try that, i used spring for sending mail but i am not getting how to validate? if i enter wrong email address then it is bouncing back to my email based on that i have to display error message to user but not getting how to do that? do you have any idea?... i tried to upload files to support my question but i am not able to upload.
i tried to upload java, word document and text file but none of them worked..
 
Sheriff
Posts: 28398
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eshwara Chaluvaiah wrote:if i enter wrong email address then it is bouncing back to my email based on that i have to display error message to user but not getting how to do that?



You haven't been reading the answers you have been given. To repeat, the answer is "You can't do that".
 
Eshwara Chaluvaiah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i read it, but if email does not exist means it will bounce back to our email know, by using that idea i have to display message to user.. using this logic its possible i think but i am not getting how to accomplish that?.. i mean to say whenever user enter his/her email i will try to send notification mail if that mail does not delivered means email id which is entered by user is not valid and if it delivers means its valid.. i think you got my point? do you have solution for this?
 
Paul Clapham
Sheriff
Posts: 28398
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's try to clarify that.

1. You ask the user for an e-mail address.

2. You try to send an e-mail message to that address. Perhaps you do that later or perhaps you do it before you send the response to the user -- I don't believe you explained that part, but it doesn't really matter.

3. A couple of hours later that e-mail message gets bounced back for some reason.

And now, if I understand correctly, you want to notify the user that this happened. Of course the user is no longer online and you don't have a valid e-mail address for them, so you can't contact them and tell them that.

And yes, I have a solution for that. My solution is to not care that the user gave me a bad e-mail address. Instead you should implement a process which makes it the user's problem if they did that. I have no idea what your application is intended to do, so I can't suggest anything in detail, but the usual way to do that is to require the user to respond in some way to the e-mail you sent to "their address" before they can do anything useful on your system.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is quite a bit older, maybe newer technology for checking email addresses in the past 2 years has come about?

If this isn't possible then how does a site like: http://verify-email.org/ exist and work? They seem to be able to tell quite quickly if the email exists.
 
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Afaik, no new technology. It's quite possible to send off a message through a mail server that will immediately forward it on to the target mail server which immediately responds with a status. However, you are still subject to the vagaries of the mail servers and network latency. It just depends on how you define "immediately" and what your level of tolerance to a delayed response is.
 
Ranch Hand
Posts: 200
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does not work reliably...



The address does not exist.
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christian Dillinger wrote:Does not work reliably...


Yup, one those pesky vagaries I alluded to before. If you can't tolerate this kind of thing, you'll have rethink your strategy along the lines that Paul mentioned.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eshwara Chaluvaiah wrote:i read it, but if email does not exist means it will bounce back to our email...


You may have read it, but you're not listening.

I was a systems administrator for 15 years and, to the best of my knowledge, there is NO reliable way to know if an e-mail address exists without requiring a response from it.

And the way to do that - as Paul has already told you - is to make it your user's responsibility to provide you with a valid and accessible e-mail address.

And the best way to do that - and the one used by most websites I know - is to send an "activation URL" (or code) to that e-mail address.

But even that only ensures that the address was OK at the time of activation. There's nothing to stop your "user" from deleting it afterwards.

HIH

Winston
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic