Email Validation using Java

Discuss all aspects of programming here.

Moderator: The Mod Squad

Email Validation using Java

Postby Ak423 » Mon Apr 14, 2008 2:29 pm

Is there any way to check if an email address actually exists before sending out a "form" email using Java mail?

I've got a form that needs to be sent out to an email address provided by the user, and I need to check if the email address exists, and if it doesn't return some kind of a error message.

So, any java pros that can help me, it would be much appreciated.
The Superior InferiorityImage
Posts: 24
Joined: Wed Feb 16, 2005 8:19 am

Postby Roach412 » Mon Apr 14, 2008 8:10 pm

if it "exists"? i don't think so. the only way to accomplish that is to actually send an email to the address, and see if you receive a reply from the admin(system) saying it's invalid.

the only way to validate that the information itself is valid is to do some string comparisons, finding the original (address) portion up to the @ symbol, then finding the remaining host information (i.e. hotmail) and then the affiliation (i.e. .com or .edu).

that will let you know whether it's a "valid" address...but not that it exists.

Lian Li Lancool First Knight Series PC-K59W
Intel Core i7-960 Bloomfield 3.2GHz
EVGA X58 FTW3 132-GT-E768-TR
G.SKILL Ripjaws Series 12GB (3 x 4GB)
Crucial M4 128gb SATAIII SSD x2
Crucial M4 256gb SATAIII SSD
OCZ Saber 1000 960GB Enterprise SSD
Corsair Professional Series HX850 PSU
Dell UltraSharp U2713HM 27" w/drop ceiling mount
Logitech G930 7.1 Headset
Logitech G402 Hyperion Fury
Black Belt 2nd Degree
Black Belt 2nd Degree
Posts: 2739
Joined: Mon Aug 09, 2004 7:33 pm
Location: Milwaukee - Wisconsin

Postby GodSquirrel » Tue Apr 15, 2008 12:55 am

why not have the receiver of the email click a validation link?

Postby Deman Risu » Wed Sep 30, 2009 6:31 pm

As a previous poster said, the only way to really "check" if an email address exists is to email it and see what happens. If it doesn't exist, you'll get an email from the "mailer daemon" usually.
Deman Risu
Posts: 6
Joined: Wed Sep 30, 2009 6:04 pm

Return to Programming

Who is online

Users browsing this forum: trendictionbot [Bot] and 0 guests