@@ -26,8 +26,8 @@ An API key is required for this module to function.
2626Go to https://www.mailboxvalidator.com/plans#api to sign up for FREE API plan and you'll be given an API key.
2727
2828
29- Usage
30- =====
29+ Usage for validating emails
30+ ===========================
3131
3232``` python
3333import MailboxValidator
@@ -183,6 +183,121 @@ The error code if there is any error. See error table below.
183183
184184The error message if there is any error. See error table below.
185185
186+
187+ Usage for checking if an email is from a disposable email provider
188+ ===================================================================
189+
190+ ``` python
191+ import MailboxValidator
192+
193+ mbv = MailboxValidator.SingleValidation(' PASTE_API_KEY_HERE' )
194+ results
= mbv.DisposableEmail(
' [email protected] ' )
195+
196+ if results is None :
197+ print (" Error connecting to API.\n " )
198+ elif results[' error_code' ] == ' ' :
199+ print (' email_address = ' + results[' email_address' ] + " \n " )
200+ print (' is_disposable = ' + results[' is_disposable' ] + " \n " )
201+ print (' credits_available = ' + str (results[' credits_available' ]) + " \n " )
202+ else :
203+ print (' error_code = ' + results[' error_code' ] + " \n " )
204+ print (' error_message = ' + results[' error_message' ] + " \n " )
205+ ```
206+
207+ Functions
208+ =========
209+
210+ ### SingleValidation(api_key)
211+
212+ Creates a new instance of the MailboxValidator object with the API key.
213+
214+ ### DisposableEmail(email_address)
215+
216+ Check if the supplied email address is from a disposable email provider.
217+
218+ Result Fields
219+ =============
220+
221+ ### email_address
222+
223+ The input email address.
224+
225+ ### is_disposable
226+
227+ Whether the email address is a temporary one from a disposable email provider.
228+
229+ Return values: True, False
230+
231+ ### credits_available
232+
233+ The number of credits left to perform validations.
234+
235+ ### error_code
236+
237+ The error code if there is any error. See error table below.
238+
239+ ### error_message
240+
241+ The error message if there is any error. See error table below.
242+
243+
244+ Usage for checking if an email is from a free email provider
245+ ============================================================
246+
247+ ``` python
248+ import MailboxValidator
249+
250+ mbv = MailboxValidator.SingleValidation(' PASTE_API_KEY_HERE' )
251+ results
= mbv.FreeEmail(
' [email protected] ' )
252+
253+ if results is None :
254+ print (" Error connecting to API.\n " )
255+ elif results[' error_code' ] == ' ' :
256+ print (' email_address = ' + results[' email_address' ] + " \n " )
257+ print (' is_free = ' + results[' is_free' ] + " \n " )
258+ print (' credits_available = ' + str (results[' credits_available' ]) + " \n " )
259+ else :
260+ print (' error_code = ' + results[' error_code' ] + " \n " )
261+ print (' error_message = ' + results[' error_message' ] + " \n " )
262+ ```
263+
264+ Functions
265+ =========
266+
267+ ### SingleValidation(api_key)
268+
269+ Creates a new instance of the MailboxValidator object with the API key.
270+
271+ ### FreeEmail(email_address)
272+
273+ Check if the supplied email address is from a free email provider.
274+
275+ Result Fields
276+ =============
277+
278+ ### email_address
279+
280+ The input email address.
281+
282+ ### is_free
283+
284+ Whether the email address is from a free email provider like Gmail or Hotmail.
285+
286+ Return values: True, False
287+
288+ ### credits_available
289+
290+ The number of credits left to perform validations.
291+
292+ ### error_code
293+
294+ The error code if there is any error. See error table below.
295+
296+ ### error_message
297+
298+ The error message if there is any error. See error table below.
299+
300+
186301Errors
187302======
188303
0 commit comments