email validation tools

How to Validate Email Addresses in Java

Check if an Email Address is correct and really exists using Java.

You can easily test if an Email Address is formatted correctly with a regex, like in the example bellow. But it will miss many important cases, like if the Email Address is well formed but the emails will bounce, because the account doesn’t exist or has recently been disabled.

					if ("".matches("[^@]+@[^@]+\\.[^@]+")) {
    // email matches pattern
} else {
    // email doesnt match pattern

Email Validation API

To do full email validation inspecting the mail server you can use and make a requests call to check it. This will do the check via the real email service which will make sure the requests are not blocked.

					String email = ???;
String apiKey = ???;
HttpClient client = HttpClient.newBuilder().build();

String jsonResult = client.send(
    .POST(HttpRequest.BodyPublishers.ofString("{\"email\":" + email + "}"))
    .setHeader("Authorization", "Api-Key " + apiKey)

String status = new JSONObject(jsonResult).getString("is_valid");

if (status == "true") {
  // the email is valid
} else {
  // the email is invalid

Be sure to signup and get your own API key.

Get started with the best Email Validator today!


Are you having trouble, have some questions. How can we help?