Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check that the email id exist in domain without sending any mails using java

Is there any way to verify where the email id exist in domain or not?

I am having the following function: it checks only for valid domain, but i need to check for valid email address in domain without sending any mails.

 public boolean isValidEmailAddress(String email) {
   boolean result = true;

   try {
      InternetAddress emailAddr = new InternetAddress(email);
      emailAddr.validate();

   } catch (AddressException ex) {
      result = false;
   }
   return result;
}
like image 769
ashu Avatar asked Nov 19 '12 11:11

ashu


1 Answers

Here is a source code that could do many type of verification, I've been using it for years :

http://www.rgagnon.com/javadetails/java-0452.html

Note : see the function isAddressValid() in the page for full validation.

like image 130
Alexandre Lavoie Avatar answered Sep 30 '22 17:09

Alexandre Lavoie