EmailValidation 1.3.0
Requires NuGet 2.12 or higher.
dotnet add package EmailValidation --version 1.3.0
NuGet\Install-Package EmailValidation -Version 1.3.0
<PackageReference Include="EmailValidation" Version="1.3.0" />
paket add EmailValidation --version 1.3.0
#r "nuget: EmailValidation, 1.3.0"
// Install EmailValidation as a Cake Addin #addin nuget:?package=EmailValidation&version=1.3.0 // Install EmailValidation as a Cake Tool #tool nuget:?package=EmailValidation&version=1.3.0
EmailValidation
What is EmailValidation?
A simple (but correct) .NET class for validating email addresses.
Supports Internationalized Mail Address standards (rfc653x).
Installing via NuGet
The easiest way to install EmailValidation is via NuGet.
In Visual Studio's Package Manager Console, enter the following command:
Install-Package EmailValidation
Getting the Source Code
First, you'll need to clone EmailValidation from my GitHub repository. To do this using the command-line version of Git, you'll need to issue the following command in your terminal:
git clone https://github.com/jstedfast/EmailValidation.git
If you are using TortoiseGit on Windows, you'll need to right-click in the directory where
where you'd like to clone EmailValidation and select Git Clone... in the menu. Once you do that, you'll get a
dialog asking you to specify the repository you'd like to clone. In the textbox labeled URL:, enter
https://github.com/jstedfast/EmailValidation.git
and then click OK. This will clone EmailValidation onto your
local machine.
Updating the Source Code
Occasionally you might want to update your local copy of the source code if I have made changes to EmailValidation since you downloaded the source code in the step above. To do this using the command-line version fo Git, you'll need to issue the following command in your terminal within the EmailValidation directory:
git pull
If you are using TortoiseGit on Windows, you'll need to right-click on the EmailValidation directory and select Git Sync... in the menu. Once you do that, you'll need to click the Pull button.
Building
Open the EmailValidation.sln solution file in Visual Studio, choose the desired build configuration (Debug or Release) and then build.
Note: The Release build will generate the xml API documentation, but the Debug build will not.
Using EmailValidation
This is quite possibly the easiest API ever to use. There is simply 1 class with 1 method.
using System;
using EmailValidation;
namespace Example {
public class Program
{
public static void Main ()
{
do {
Console.Write ("Enter an email address: ");
var input = Console.ReadLine ();
if (input == null)
break;
input = input.Trim ();
Console.WriteLine ("{0} is {1}!", input, EmailValidator.Validate (input) ? "valid" : "invalid");
} while (true);
Console.WriteLine ();
}
}
}
License Information
EmailValidation is Copyright (C) 2013-2025 Jeffrey Stedfast and is licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Other Implementations:
If you need an implementation in something other than C#, perhaps one of the following ports will be helpful:
- javascript by Pavel Azanov
- pascal by Ugochukwu Mmaduekwe
- Swift by Evan Robertson
- Dart by Fredrik Eilertsen
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETStandard 2.1
- System.ComponentModel.Annotations (>= 5.0.0)
-
net8.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on EmailValidation:
Package | Downloads |
---|---|
Soenneker.Validators.Email.Syntax
A validation module for checking email syntax |
|
Enigmatry.Entry.Email
Building Block for adding an Email client to an Entry based project |
|
ClearFlow.ValueObjects
Common value objects available with ClearFlow |
|
KoveEnterprises.Lib.Email
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on EmailValidation:
Repository | Stars |
---|---|
bkaankose/Wino-Mail
Built-in Mail & Calendars app clone for Windows.
|
|
EvotecIT/Mailozaurr
Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and probably some other ways to interact with Email. Underneath it uses MimeKit and MailKit libraries written by Jeffrey Stedfast.
|
Version | Downloads | Last updated |
---|---|---|
1.3.0 | 16,657 | 3/3/2025 |
1.2.0 | 469,084 | 5/16/2024 |
1.0.10 | 636,701 | 9/2/2023 |
1.0.9 | 244,905 | 4/22/2023 |
1.0.8 | 636,549 | 6/9/2022 |
1.0.7 | 137,315 | 2/23/2022 |
1.0.6 | 259,926 | 9/1/2021 |
1.0.5 | 18,235 | 7/29/2021 |
1.0.4 | 230,103 | 11/15/2020 |
1.0.3 | 868,674 | 4/4/2017 |
1.0.2 | 2,595 | 10/23/2016 |
1.0.1 | 1,835 | 10/21/2016 |
1.0.0 | 2,272 | 10/5/2016 |
* Dropped support for net6.0 but added net8.0 in its place.
* Allow custom error messages in EmailAttribute.