check e-mail address
Hi, I'm doing an applet in java where I get users e-mail address. I'm trying to check if the e-mail is right written, something@something.something .Do you know how to do it?, or some webpage that can explain it?.
Thanks in advance. |
Hi painkiller, I think for solutions you have to search on any java site or java documentation.:D
|
Wait some minutes and I can write something for you.......
|
test@linuxquestions.org "is valid"
test@linuxquestionsorg "not valid" test@linuxquestions@org "not valid" test.linuxquestions@org "not valid" test@linuxquestions.org. "not valid" (ending with a dot) and so on...... It's not perfekt 100% but I hope it's better than nothing Code:
import java.util.*; |
Email Validation
Check out this Site http://www.network-tools.com it has got a Email Validation there
|
I didnt do this in Java but I did it in PHP, the way that I did it was to make sure that it was valid by splitting it round the @ sign and checking both of the sections for anything invalid, I then ran the checkdns function on the domain to check that it exists.
Shak |
I did something similar in PHP to a few months ago and I was also checking with DNS if the domain existed.
But in an performences point of view it's a bad idé. It all depends on how fast you want the 'Email checking' to be |
Thats a fair point, it depends what its for, if its for something really important then its worth taking the time out to do it :)
Shak |
That's true
|
Thanks a lot. Sorry for answering so so late, but I had some problems, bike crash, and I wasn´t in the mood of programming, now everything is OK and I'm back.
|
You can do regular expression checking the same sort of way as perl does on strings if you just want to test the syntax
stringname.match("<expression") something you could look into I guess if you wanted. |
All times are GMT -5. The time now is 05:25 AM. |