Java SDK · Feature

Email Validation & Verification in Java

Check whether an email address is real, deliverable, and safe to accept — before it ever enters your database. The SDK exposes three levels: a fast syntax/MX/disposable check, full SMTP verification, and a batch endpoint for cleaning whole lists.

Trusted by thousands of businesses
Fast JSON API responses
Real-time validation
Simple integration, SDKs & examples
What it does

Three levels of email checking

Not every check needs an SMTP probe. emailInfo validates syntax and MX and flags disposable providers fast enough to run inline on a sign-up form. validateEmail goes further, connecting to the mail server to confirm the mailbox is deliverable and adding role-account, free-provider, and catch-all signals. validateEmailBatch applies that advanced check across an entire list in one request.

Prerequisites

1

Fast check with emailInfo

A lightweight check (no SMTP probe): validates syntax, confirms the domain has MX records, and flags disposable/throwaway providers. Use it inline on sign-up forms.

IpApiClient client = IpApiClient.builder()
        .apiKey(System.getenv("IP_API_IO_KEY"))
        .build();

var info = client.emailInfo("user@example.com");

System.out.println(info.syntax().isValid()); // true
System.out.println(info.isDisposable());     // false
System.out.println(info.hasMxRecords());     // true
if (!info.mxRecords().isEmpty()) {
    System.out.println(info.mxRecords().get(0).hostname());
}
2

Full SMTP verification with validateEmail

Advanced verification that connects to the mail server to confirm the mailbox is deliverable, and adds role-account, free-provider, catch-all and Gravatar signals.

var result = client.validateEmail("user@example.com");

System.out.println(result.reachable()); // "yes" | "no" | "unknown"
if (result.smtp() != null) {
    System.out.println(result.smtp().deliverable() + " " + result.smtp().catchAll());
}
System.out.println(result.disposable());  // false
System.out.println(result.roleAccount()); // false  (e.g. info@, support@)
System.out.println(result.free());        // false  (e.g. gmail.com)
if (result.suggestion() != null) {
    System.out.println(result.suggestion()); // typo fix, e.g. "user@gmail.com"
}
3

Clean a list with validateEmailBatch

Advanced-validate up to 100 addresses in one request — the building block for email list cleaning. Throws if the list is empty or longer than 100.

var batch = client.validateEmailBatch(
        List.of("user@example.com", "fake@mailinator.com"));

System.out.println(batch.totalProcessed());        // 2
System.out.println(batch.successfulValidations()); // 2

batch.results().forEach((email, result) ->
    System.out.println(email + " " + result.reachable() + " " + result.disposable()));
Reference

Response reference

AdvancedEmailValidation (from validateEmail)

AccessorTypeDescription
email()StringThe address checked
reachable()String"yes", "no" or "unknown"
smtp()AdvancedSmtphostExists(), deliverable(), fullInbox(), catchAll(), disabled()
gravatar()AdvancedGravatarhasGravatar(), gravatarUrl()
suggestion()StringSuggested correction for a likely typo
disposable()booleanThrowaway provider
roleAccount()booleanRole address (info@, sales@, …)
free()booleanFree webmail provider
hasMxRecords()booleanDomain can receive mail
FAQ

Frequently asked questions

How do I validate an email address in Java?

For a fast check, call client.emailInfo(email) — it validates syntax, confirms the domain has MX records, and flags disposable providers without an SMTP probe. For full deliverability, use client.validateEmail(email), which connects to the mail server.

What's the difference between emailInfo and validateEmail?

emailInfo is a lightweight syntax/MX/disposable check, ideal inline on sign-up forms. validateEmail performs advanced SMTP verification and adds role-account, free-provider, catch-all and Gravatar signals — use it before sending important mail or accepting a paying customer.

How do I clean a whole list of emails?

Use client.validateEmailBatch(emails) with up to 100 addresses per request — the building block for email list cleaning. It returns a results() map of email to result.

Can it detect disposable / throwaway emails?

Yes. Both emailInfo and validateEmail return a disposable flag (isDisposable() / disposable()) for throwaway providers like mailinator.com, so you can reject or down-rank them at sign-up.

Start building with the ip-api.io Java SDK

Add io.ip-api:ipapi to your build, drop in your free API key, and ship in minutes — one client for geolocation, fraud detection, and email validation.

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Found a bug in the SDK?

The io.ip-api:ipapi library is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub