@@ -17,7 +17,7 @@ Add the following to your composer.json file:
1717
1818```
1919"require": {
20- "mailboxvalidator/mailboxvalidator-php": "1.0 .*"
20+ "mailboxvalidator/mailboxvalidator-php": "1.1 .*"
2121}
2222```
2323
@@ -30,8 +30,8 @@ An API key is required for this module to function.
3030Go to https://www.mailboxvalidator.com/plans#api to sign up for FREE API plan and you'll be given an API key.
3131
3232
33- Usage
34- =====
33+ Usage for validating emails
34+ ===========================
3535
3636``` php
3737<?php
@@ -195,6 +195,137 @@ The error code if there is any error. See error table below.
195195
196196The error message if there is any error. See error table below.
197197
198+
199+ Usage for checking if an email is from a disposable email provider
200+ ==================================================================
201+
202+ ``` php
203+ <?php
204+ require_once __DIR__ . '/vendor/autoload.php';
205+
206+ use MailboxValidator\SingleValidation;
207+
208+ $mbv = new SingleValidation('PASTE_YOUR_API_KEY_HERE');
209+
210+ $results = $mbv->DisposableEmail('example@example.com');
211+
212+ if ($results === false) {
213+ echo "Error connecting to API.\n";
214+ }
215+ else if (trim($results->error_code) == '') {
216+ echo 'email_address = ' . $results->email_address . "\n";
217+ echo 'is_disposable = ' . $results->is_disposable . "\n";
218+ echo 'credits_available = ' . $results->credits_available . "\n";
219+ }
220+ else {
221+ echo 'error_code = ' . $results->error_code . "\n";
222+ echo 'error_message = ' . $results->error_message . "\n";
223+ }
224+ ?>
225+ ```
226+
227+ Functions
228+ =========
229+
230+ ### SingleValidation(api_key)
231+
232+ Creates a new instance of the MailboxValidator object with the API key.
233+
234+ ### DisposableEmail(email_address)
235+
236+ Check if the supplied email address is from a disposable email provider.
237+
238+ Result Fields
239+ =============
240+
241+ ### email_address
242+
243+ The input email address.
244+
245+ ### is_disposable
246+
247+ Whether the email address is a temporary one from a disposable email provider.
248+
249+ Return values: True, False
250+
251+ ### credits_available
252+
253+ The number of credits left to perform validations.
254+
255+ ### error_code
256+
257+ The error code if there is any error. See error table below.
258+
259+ ### error_message
260+
261+ The error message if there is any error. See error table below.
262+
263+
264+ Usage for checking if an email is from a free email provider
265+ ============================================================
266+
267+ ``` php
268+ <?php
269+ require_once __DIR__ . '/vendor/autoload.php';
270+
271+ use MailboxValidator\SingleValidation;
272+
273+ $mbv = new SingleValidation('PASTE_YOUR_API_KEY_HERE');
274+
275+ $results = $mbv->FreeEmail('example@example.com');
276+
277+ if ($results === false) {
278+ echo "Error connecting to API.\n";
279+ }
280+ else if (trim($results->error_code) == '') {
281+ echo 'email_address = ' . $results->email_address . "\n";
282+ echo 'is_free = ' . $results->is_free . "\n";
283+ echo 'credits_available = ' . $results->credits_available . "\n";
284+ }
285+ else {
286+ echo 'error_code = ' . $results->error_code . "\n";
287+ echo 'error_message = ' . $results->error_message . "\n";
288+ }
289+ ?>
290+ ```
291+
292+ Functions
293+ =========
294+
295+ ### SingleValidation(api_key)
296+
297+ Creates a new instance of the MailboxValidator object with the API key.
298+
299+ ### FreeEmail(email_address)
300+
301+ Check if the supplied email address is from a free email provider.
302+
303+ Result Fields
304+ =============
305+
306+ ### email_address
307+
308+ The input email address.
309+
310+ ### is_free
311+
312+ Whether the email address is from a free email provider like Gmail or Hotmail.
313+
314+ Return values: True, False
315+
316+ ### credits_available
317+
318+ The number of credits left to perform validations.
319+
320+ ### error_code
321+
322+ The error code if there is any error. See error table below.
323+
324+ ### error_message
325+
326+ The error message if there is any error. See error table below.
327+
328+
198329Errors
199330======
200331
0 commit comments