C# email verification
Verify emails in C# with Verifly
Add a live email verification step to any .NET app with the HttpClient you already inject. Verifly is an API-first, pay-as-you-go service — send an address, deserialize a clean JSON verdict with System.Text.Json, and drop bad mailboxes before they reach your SMTP relay or CRM.
using System.Net.Http;
using System.Text.Json;
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer vf_YOUR_KEY");
var url = "https://verifly.email/api/v1/verify?email=user@example.com";
using var stream = await http.GetStreamAsync(url);
using var doc = await JsonDocument.ParseAsync(stream);
var root = doc.RootElement;
Console.WriteLine(root.GetProperty("result").GetString());
Console.WriteLine(root.GetProperty("is_valid").GetBoolean());Real-time SMTP mailbox checks
Single, batch, and async bulk verification
Disposable, role account, and catch-all detection
Pay-as-you-go credits with no subscription lock-in
Search fit
Built for C# email verification
Use Verifly when you need a simple API, predictable pricing, and clean JSON results before emails hit your product, CRM, or campaign tool.
Email verification the .NET way
In a typed language like C#, the temptation is to lean on System.Net.Mail.MailAddress or a regular expression and call the job done. Both only check that an address is syntactically plausible. MailAddress will happily accept user@dead-domain.com, and a regex tells you nothing about whether a mailbox actually accepts mail. The truth lives on the far side of an SMTP handshake, and that is exactly what Verifly performs for you over a single HTTPS request.
Because Verifly is a plain REST API, you do not add a NuGet dependency or a native binding — the HttpClient that ships with .NET is all you need, ideally the pooled instance you get from IHttpClientFactory rather than a new one per call. You send a GET to /api/v1/verify with a Bearer key, and you deserialize the response with System.Text.Json, either into a record via JsonSerializer or by reading fields off a JsonDocument as shown above. The response carries a result field of deliverable, undeliverable, or risky plus boolean flags for disposable, role, catch_all, and smtp.
The pricing model suits both a long-running ASP.NET Core service and a one-off console tool. Grab a key, spend credits from $2 per 1,000 checks down to $0.60 per 1,000 at volume, and the same key works from a Kestrel app, an Azure Function, or a Windows service. Self-register for 100 free credits with no card at the autonomous register endpoint and start calling immediately.
Batch-verify a list of emails in C#
When you hold more than a handful of addresses, do not fire the single endpoint in a loop — POST them together to /api/v1/verify/batch. It takes a JSON body with an emails array and returns a results array in the same order, which maps naturally onto a strongly typed record and a LINQ Where clause. Serialize your list with System.Text.Json and deserialize the response into a small DTO.
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
record VerifyResult(string Email, string Result,
[property: JsonPropertyName("is_valid")] bool IsValid,
bool Disposable, bool Role);
record BatchResponse(List<VerifyResult> Results);
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer vf_YOUR_KEY");
var emails = new[] { "ada@example.com", "info@acme.com", "noreply@disposable.tld" };
var resp = await http.PostAsJsonAsync(
"https://verifly.email/api/v1/verify/batch",
new { emails });
var batch = await resp.Content.ReadFromJsonAsync<BatchResponse>();
var keep = batch!.Results
.Where(r => r.Result == "deliverable" && !r.Disposable && !r.Role)
.Select(r => r.Email)
.ToList();
Console.WriteLine($"Keeping {keep.Count} of {batch.Results.Count} addresses");Wire it into an ASP.NET Core signup
The most valuable place to verify in .NET is the moment a user registers. Inject a typed HttpClient into your controller or minimal-API handler, call Verifly with a short timeout, and reject disposable addresses before you write the account. Wrap the call in a try/catch so a transient network error never blocks a legitimate signup — fail open and let the registration through.
app.MapPost("/register", async (RegisterDto dto, IHttpClientFactory factory) =>
{
var http = factory.CreateClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer vf_YOUR_KEY");
http.Timeout = TimeSpan.FromSeconds(8);
try
{
var url = $"https://verifly.email/api/v1/verify?email={Uri.EscapeDataString(dto.Email)}";
using var doc = JsonDocument.Parse(await http.GetStringAsync(url));
var root = doc.RootElement;
if (root.GetProperty("disposable").GetBoolean())
return Results.BadRequest("Disposable addresses are not allowed.");
if (root.GetProperty("result").GetString() == "undeliverable")
return Results.BadRequest("That mailbox does not exist.");
}
catch (HttpRequestException)
{
// fail open: never block signup on a network error
}
return Results.Ok(await CreateUserAsync(dto));
});FAQ
Frequently asked questions
Do I need a NuGet package to use Verifly from C#?
No. Verifly is a plain REST API, so the built-in HttpClient plus System.Text.Json is everything you need. There is no SDK to install and no native dependency — a GET to /api/v1/verify with a Bearer header returns clean JSON you can deserialize into a record.
Should I create a new HttpClient per verification call?
No — reuse a pooled client. Register a typed client through IHttpClientFactory and inject it, which avoids socket exhaustion. Set the Authorization header and an 8-second timeout once on the client rather than per request.
How do I verify a whole list of contacts in .NET?
Send them to POST /api/v1/verify/batch as a JSON emails array and deserialize the results array into a strongly typed record list. Then filter with LINQ on the result field. Batching is faster and cheaper than looping the single endpoint.
What fields come back in the JSON response?
Each result has result (deliverable, undeliverable, or risky), is_valid, and boolean flags disposable, role, catch_all, and smtp. Branch on result for the headline decision and use the flags to strip throwaway or generic role mailboxes.
Can I call Verifly from an Azure Function or worker service?
Yes. The same Bearer key works from Kestrel, an Azure Function, a BackgroundService, or a console app. For AI agents, Verifly also exposes an MCP server at verifly.email/mcp.
What does C# email verification cost?
Pricing is pay-as-you-go from $2 per 1,000 checks down to $0.60 per 1,000 at volume, with 100 free credits when you self-register. There is no subscription, so an occasional cleaning job costs only the credits it spends.