Skip to content

Commit 516b170

Browse files
Updated for compatibility with .NET 9
1 parent bf159aa commit 516b170

File tree

9 files changed

+122
-382
lines changed

9 files changed

+122
-382
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 MailboxValidator.com
3+
Copyright (c) 2025 MailboxValidator.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MailboxValidatorCSharp/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 MailboxValidator.com
3+
Copyright (c) 2025 MailboxValidator.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MailboxValidatorCSharp/MailboxValidatorCSharp/MailboxValidatorCSharp.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<PropertyGroup>
44
<RootNamespace>MailboxValidator</RootNamespace>
5-
<TargetFrameworks>netstandard2.0;net472;net48;net481;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;net472;net48;net481;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
66
<AssemblyName>MailboxValidator</AssemblyName>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<PackageId>MailboxValidator.SingleValidation</PackageId>
9-
<Version>2.0.1</Version>
9+
<Version>2.0.2</Version>
1010
<Authors>MailboxValidator.com</Authors>
1111
<Company>MailboxValidator.com</Company>
1212
<Title>MailboxValidator</Title>
@@ -24,12 +24,12 @@ An API key is required for this library to function.
2424

2525
Go to https://www.mailboxvalidator.com/plans#api to sign up for FREE API plan and you'll be given an API key.
2626
</Description>
27-
<Copyright>Copyright 2024 MailboxValidator.com</Copyright>
27+
<Copyright>Copyright 2025 MailboxValidator.com</Copyright>
2828
<PackageProjectUrl>https://www.mailboxvalidator.com/dotnet</PackageProjectUrl>
2929
<PackageIcon>mbv-logo-square-128.png</PackageIcon>
3030
<PackageLicenseFile></PackageLicenseFile>
3131
<PackageTags>mailboxvalidator .net email-validator email-validation email-checker verify-email</PackageTags>
32-
<PackageReleaseNotes>Updated for compatibility with .NET 8</PackageReleaseNotes>
32+
<PackageReleaseNotes>Updated for compatibility with .NET 9</PackageReleaseNotes>
3333
<PackageLicenseExpression>MIT</PackageLicenseExpression>
3434
<RepositoryType>git</RepositoryType>
3535
<PackageReadmeFile>README.md</PackageReadmeFile>

MailboxValidatorCSharp/README.md

Lines changed: 18 additions & 278 deletions
Original file line numberDiff line numberDiff line change
@@ -1,278 +1,18 @@
1-
MailboxValidator C# Libary
2-
==========================
3-
4-
This C# library provides an easy way to call the MailboxValidator API which validates if an email address is a valid one.
5-
6-
This library can be used in many types of projects such as:
7-
8-
- validating a user's email during sign up
9-
- cleaning your mailing list prior to an email marketing campaign
10-
- a form of fraud check
11-
12-
Compilation
13-
===========
14-
15-
Just open the solution file in Visual Studio 2022 or later and compile:
16-
17-
Dependencies
18-
============
19-
20-
An API key is required for this library to function.
21-
22-
Go to https://www.mailboxvalidator.com/plans#api to sign up for a FREE API plan and you'll be given an API key.
23-
24-
Usage for validating emails
25-
===========================
26-
27-
```csharp
28-
using Newtonsoft.Json;
29-
using MailboxValidator;
30-
31-
var apikey = "PASTE_YOUR_API_KEY_HERE";
32-
var email = "[email protected]";
33-
SingleValidation mbv = new SingleValidation(apikey);
34-
35-
var mytask = mbv.ValidateEmailAsync(email); // async API Call
36-
var myobj = mytask.Result;
37-
38-
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)); // to pretty-print the JSON
39-
40-
Console.WriteLine("email_address:" + myobj["email_address"].ToString());
41-
Console.WriteLine("domain:" + myobj["domain"].ToString());
42-
Console.WriteLine("is_free:" + myobj["is_free"].ToString());
43-
Console.WriteLine("is_syntax:" + myobj["is_syntax"].ToString());
44-
Console.WriteLine("is_domain:" + myobj["is_domain"].ToString());
45-
Console.WriteLine("is_smtp:" + myobj["is_smtp"].ToString());
46-
Console.WriteLine("is_verified:" + myobj["is_verified"].ToString());
47-
Console.WriteLine("is_server_down:" + myobj["is_server_down"].ToString());
48-
Console.WriteLine("is_greylisted:" + myobj["is_greylisted"].ToString());
49-
Console.WriteLine("is_disposable:" + myobj["is_disposable"].ToString());
50-
Console.WriteLine("is_suppressed:" + myobj["is_suppressed"].ToString());
51-
Console.WriteLine("is_role:" + myobj["is_role"].ToString());
52-
Console.WriteLine("is_high_risk:" + myobj["is_high_risk"].ToString());
53-
Console.WriteLine("is_catchall:" + myobj["is_catchall"].ToString());
54-
Console.WriteLine("mailboxvalidator_score:" + myobj["mailboxvalidator_score"].ToString());
55-
Console.WriteLine("time_taken:" + myobj["time_taken"].ToString());
56-
Console.WriteLine("status:" + myobj["status"].ToString());
57-
Console.WriteLine("credits_available:" + myobj["credits_available"].ToString());
58-
```
59-
60-
Functions
61-
=========
62-
63-
### SingleValidation(api_key)
64-
65-
Creates a new instance of the MailboxValidator object with the API key.
66-
67-
### ValidateEmailAsync(email_address)
68-
69-
Performs email validation on the supplied email address.
70-
71-
Result Fields
72-
=============
73-
74-
### email_address
75-
76-
The input email address.
77-
78-
### domain
79-
80-
The domain of the email address.
81-
82-
### is_free
83-
84-
Whether the email address is from a free email provider like Gmail or Hotmail.
85-
86-
Return values: True, False
87-
88-
### is_syntax
89-
90-
Whether the email address is syntactically correct.
91-
92-
Return values: True, False
93-
94-
### is_domain
95-
96-
Whether the email address has a valid MX record in its DNS entries.
97-
98-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
99-
100-
### is_smtp
101-
102-
Whether the mail servers specified in the MX records are responding to connections.
103-
104-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
105-
106-
### is_verified
107-
108-
Whether the mail server confirms that the email address actually exist.
109-
110-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
111-
112-
### is_server_down
113-
114-
Whether the mail server is currently down or unresponsive.
115-
116-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
117-
118-
### is_greylisted
119-
120-
Whether the mail server employs greylisting where an email has to be sent a second time at a later time.
121-
122-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
123-
124-
### is_disposable
125-
126-
Whether the email address is a temporary one from a disposable email provider.
127-
128-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
129-
130-
### is_suppressed
131-
132-
Whether the email address is in our blacklist.
133-
134-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
135-
136-
### is_role
137-
138-
Whether the email address is a role-based email address like [email protected] or [email protected].
139-
140-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
141-
142-
### is_high_risk
143-
144-
Whether the email address contains high risk keywords.
145-
146-
Return values: True, False, -&nbsp;&nbsp;&nbsp;(- means not applicable)
147-
148-
### is_catchall
149-
150-
Whether the email address is a catch-all address.
151-
152-
Return values: True, False, Unknown, -&nbsp;&nbsp;&nbsp;(- means not applicable)
153-
154-
### mailboxvalidator_score
155-
156-
Email address reputation score.
157-
158-
Score > 0.70 means good; score > 0.40 means fair; score <= 0.40 means poor.
159-
160-
### time_taken
161-
162-
The time taken to get the results in seconds.
163-
164-
### status
165-
166-
Whether our system think the email address is valid based on all the previous fields.
167-
168-
Return values: True, False
169-
170-
### credits_available
171-
172-
The number of credits left to perform validations.
173-
174-
175-
Usage for checking if an email is from a disposable email provider
176-
==================================================================
177-
178-
```csharp
179-
using Newtonsoft.Json;
180-
using MailboxValidator;
181-
182-
var apikey = "PASTE_YOUR_API_KEY_HERE";
183-
var email = "[email protected]";
184-
SingleValidation mbv = new SingleValidation(apikey);
185-
186-
var mytask = mbv.DisposableEmailAsync(email); // async API Call
187-
var myobj = mytask.Result;
188-
189-
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)); // to pretty-print the JSON
190-
191-
Console.WriteLine("email_address:" + myobj["email_address"].ToString());
192-
Console.WriteLine("is_disposable:" + myobj["is_disposable"].ToString());
193-
Console.WriteLine("credits_available:" + myobj["credits_available"].ToString());
194-
```
195-
196-
Functions
197-
=========
198-
199-
### SingleValidation(api_key)
200-
201-
Creates a new instance of the MailboxValidator object with the API key.
202-
203-
### DisposableEmailAsync(email_address)
204-
205-
Check if the supplied email address is from a disposable email provider.
206-
207-
Result Fields
208-
=============
209-
210-
### email_address
211-
212-
The input email address.
213-
214-
### is_disposable
215-
216-
Whether the email address is a temporary one from a disposable email provider.
217-
218-
Return values: True, False
219-
220-
### credits_available
221-
222-
The number of credits left to perform validations.
223-
224-
225-
Usage for checking if an email is from a free email provider
226-
============================================================
227-
228-
```csharp
229-
using Newtonsoft.Json;
230-
using MailboxValidator;
231-
232-
var apikey = "PASTE_YOUR_API_KEY_HERE";
233-
var email = "[email protected]";
234-
SingleValidation mbv = new SingleValidation(apikey);
235-
236-
var mytask = mbv.FreeEmailAsync(email); // async API Call
237-
var myobj = mytask.Result;
238-
239-
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)); // to pretty-print the JSON
240-
241-
Console.WriteLine("email_address:" + myobj["email_address"].ToString());
242-
Console.WriteLine("is_free:" + myobj["is_free"].ToString());
243-
Console.WriteLine("credits_available:" + myobj["credits_available"].ToString());
244-
```
245-
246-
Functions
247-
=========
248-
249-
### SingleValidation(api_key)
250-
251-
Creates a new instance of the MailboxValidator object with the API key.
252-
253-
### FreeEmailAsync(email_address)
254-
255-
Check if the supplied email address is from a free email provider.
256-
257-
Result Fields
258-
=============
259-
260-
### email_address
261-
262-
The input email address.
263-
264-
### is_free
265-
266-
Whether the email address is from a free email provider like Gmail or Hotmail.
267-
268-
Return values: True, False
269-
270-
### credits_available
271-
272-
The number of credits left to perform validations.
273-
274-
275-
Copyright
276-
=========
277-
278-
Copyright (C) 2024 by MailboxValidator.com, [email protected]
1+
MailboxValidator C# Libary
2+
==========================
3+
4+
This C# library provides an easy way to call the MailboxValidator API which validates if an email address is a valid one.
5+
6+
This library can be used in many types of projects such as:
7+
8+
- validating a user's email during sign up
9+
- cleaning your mailing list prior to an email marketing campaign
10+
- a form of fraud check
11+
12+
# Developer Documentation
13+
To learn more about installation, usage, and code examples, please visit the developer documentation at [https://mailboxvalidator-csharp.readthedocs.io/en/latest/index.html.](https://mailboxvalidator-csharp.readthedocs.io/en/latest/index.html)
14+
15+
Copyright
16+
=========
17+
18+
Copyright (C) 2025 by MailboxValidator.com, [email protected]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ To learn more about installation, usage, and code examples, please visit the dev
1515
Copyright
1616
=========
1717

18-
Copyright (C) 2024 by MailboxValidator.com, [email protected]
18+
Copyright (C) 2025 by MailboxValidator.com, [email protected]
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.7.34031.279
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMailboxValidatorCSharp", "TestMailboxValidatorCSharp\TestMailboxValidatorCSharp.csproj", "{464DC3E4-A072-4696-8EDD-C226285D45F7}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Release|Any CPU.Build.0 = Release|Any CPU
18-
EndGlobalSection
19-
GlobalSection(SolutionProperties) = preSolution
20-
HideSolutionNode = FALSE
21-
EndGlobalSection
22-
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {67136BDB-D922-472F-8261-CCF86EFC876B}
24-
EndGlobalSection
25-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.7.34031.279
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMailboxValidatorCSharp", "TestMailboxValidatorCSharp\TestMailboxValidatorCSharp.csproj", "{464DC3E4-A072-4696-8EDD-C226285D45F7}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{464DC3E4-A072-4696-8EDD-C226285D45F7}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {67136BDB-D922-472F-8261-CCF86EFC876B}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)