Rust SDK · Feature

Email Validation & Verification in Rust

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. email_info validates syntax and MX and flags disposable providers fast enough to run inline on a sign-up form. validate_email goes further, connecting to the mail server to confirm the mailbox is deliverable and adding role-account, free-provider, and catch-all signals. validate_email_batch applies that advanced check across an entire list in one request.

Prerequisites

1

Fast check with email_info

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.

let client = Client::new(std::env::var("IP_API_IO_KEY")?);

let info = client.email_info("user@example.com").await?;

println!("{}", info.syntax.is_valid); // true
println!("{}", info.is_disposable);   // false
println!("{}", info.has_mx_records);  // true
if let Some(record) = info.mx_records.first() {
    println!("{}", record.hostname);
}
2

Full SMTP verification with validate_email

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.

let result = client.validate_email("user@example.com").await?;

println!("{}", result.reachable); // "yes" | "no" | "unknown"
if let Some(smtp) = &result.smtp {
    println!("{} {}", smtp.deliverable, smtp.catch_all);
}
println!("{}", result.disposable);   // false
println!("{}", result.role_account); // false  (e.g. info@, support@)
println!("{}", result.free);         // false  (e.g. gmail.com)
if let Some(suggestion) = &result.suggestion {
    println!("{suggestion}");        // typo fix, e.g. "user@gmail.com"
}
3

Clean a list with validate_email_batch

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

let batch = client
    .validate_email_batch(&["user@example.com", "fake@mailinator.com"])
    .await?;

println!("{}", batch.total_processed);        // 2
println!("{}", batch.successful_validations); // 2

for (email, result) in &batch.results {
    println!("{email} {} {}", result.reachable, result.disposable);
}
Reference

Response reference

AdvancedEmailValidation (from validate_email)

FieldTypeDescription
emailStringThe address checked
reachableString"yes", "no" or "unknown"
smtpOption<AdvancedSmtp>host_exists, deliverable, full_inbox, catch_all, disabled
gravatarOption<AdvancedGravatar>has_gravatar, gravatar_url
suggestionOption<String>Suggested correction for a likely typo
disposableboolThrowaway provider
role_accountboolRole address (info@, sales@, …)
freeboolFree webmail provider
has_mx_recordsboolDomain can receive mail
FAQ

Frequently asked questions

How do I validate an email address in Rust?

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

What's the difference between email_info and validate_email?

email_info is a lightweight syntax/MX/disposable check, ideal inline on sign-up forms. validate_email 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.validate_email_batch(emails).await? with up to 100 addresses per request — the building block for email list cleaning. It returns a results map of email to result and errors if the slice is empty or longer than 100.

Can it detect disposable / throwaway emails?

Yes. Both email_info and validate_email return a disposable flag (is_disposable / 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 Rust SDK

Run cargo add ip-api-io, drop in your free API key, and ship in minutes — one async 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 ip-api-io crate is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub