Well executed email validation can save you a ton of headache. It lets you filter out fake user submissions and avoid wasting bandwidth when sending out emails, just to name a couple. Unfortunately, most email validation is pretty basic and only checks the email address’s format. This can easily be fooled. Today we will be looking at how to use an API to perform full validation on an email address, querying the mail server to get a guaranteed result. Let’s dive right in.
First, install the API client by running the following command in the Package Manager console:
Install-Package Cloudmersive.APIClient.NET.Validate -Version 1.2.7
Now, simply run the EmailFullValidation function and provided it with your email address.
using Cloudmersive.APIClient.NET.Validate.Model;namespace Example
public class EmailFullValidationExample
public void main()
// Configure API key authorization: Apikey
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new EmailApi();
var email = email_example; // string | Email address to validate, e.g. \"firstname.lastname@example.org\". The input is a string so be sure to enclose it in double-quotes.try
// Fully validate an email address
FullEmailValidationResponse result = apiInstance.EmailFullValidation(email);
catch (Exception e)
Debug.Print("Exception when calling EmailApi.EmailFullValidation: " + e.Message );
And we are already done. Our response will include a variety of useful data, including the syntax and domain validity, as well as the domain name and whether it is a free email provider. Here is an example using email@example.com: