.NET SDK · Feature

Email Validation & Verification in .NET

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

Prerequisites

1

Fast check with EmailInfoAsync

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.

var client = new IpApiClient(Environment.GetEnvironmentVariable("IP_API_IO_KEY")!);

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

Console.WriteLine(info.Syntax.IsValid); // True
Console.WriteLine(info.IsDisposable);   // False
Console.WriteLine(info.HasMxRecords);   // True
if (info.MxRecords.FirstOrDefault() is { } record)
    Console.WriteLine(record.Hostname);
2

Full SMTP verification with ValidateEmailAsync

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 = await client.ValidateEmailAsync("user@example.com");

Console.WriteLine(result.Reachable); // "yes" | "no" | "unknown"
if (result.Smtp is { } smtp)
    Console.WriteLine($"{smtp.Deliverable} {smtp.CatchAll}");
Console.WriteLine(result.Disposable);  // False
Console.WriteLine(result.RoleAccount); // False  (e.g. info@, support@)
Console.WriteLine(result.Free);        // False  (e.g. gmail.com)
if (result.Suggestion is { } suggestion)
    Console.WriteLine(suggestion);     // typo fix, e.g. "user@gmail.com"
3

Clean a list with ValidateEmailBatchAsync

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 = await client.ValidateEmailBatchAsync(
    new[] { "user@example.com", "fake@mailinator.com" });

Console.WriteLine(batch.TotalProcessed);        // 2
Console.WriteLine(batch.SuccessfulValidations); // 2

foreach (var (email, result) in batch.Results)
    Console.WriteLine($"{email} {result.Reachable} {result.Disposable}");
Reference

Response reference

AdvancedEmailValidation (from ValidateEmailAsync)

PropertyTypeDescription
EmailstringThe address checked
Reachablestring"yes", "no" or "unknown"
SmtpAdvancedSmtp?HostExists, Deliverable, FullInbox, CatchAll, Disabled
GravatarAdvancedGravatar?HasGravatar, GravatarUrl
Suggestionstring?Suggested correction for a likely typo
DisposableboolThrowaway provider
RoleAccountboolRole address (info@, sales@, …)
FreeboolFree webmail provider
HasMxRecordsboolDomain can receive mail
FAQ

Frequently asked questions

How do I validate an email address in C#?

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

What's the difference between EmailInfoAsync and ValidateEmailAsync?

EmailInfoAsync is a lightweight syntax/MX/disposable check, ideal inline on sign-up forms. ValidateEmailAsync 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 await client.ValidateEmailBatchAsync(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 EmailInfoAsync and ValidateEmailAsync 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 .NET SDK

Run dotnet add package IpApiIo, 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 IpApiIo package is open source. Open an issue or pull request on GitHub and we'll take a look.

Open on GitHub