|
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 | | - |
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, - (- 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, - (- 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, - (- 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, - (- 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, - (- 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, - (- means not applicable) |
129 | | - |
130 | | -### is_suppressed |
131 | | - |
132 | | -Whether the email address is in our blacklist. |
133 | | - |
134 | | -Return values: True, False, - (- 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, - (- means not applicable) |
141 | | - |
142 | | -### is_high_risk |
143 | | - |
144 | | -Whether the email address contains high risk keywords. |
145 | | - |
146 | | -Return values: True, False, - (- 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, - (- 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 | | - |
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 | | - |
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] |
0 commit comments