Skip to content

Commit d00e12e

Browse files
Add Readthedocs documentation.
1 parent 7bc94e7 commit d00e12e

File tree

11 files changed

+409
-0
lines changed

11 files changed

+409
-0
lines changed

.readthedocs.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the OS, Python version and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
# You can also specify other tool versions:
14+
# nodejs: "19"
15+
# rust: "1.64"
16+
# golang: "1.19"
17+
18+
# Build documentation in the "docs/" directory with Sphinx
19+
sphinx:
20+
configuration: docs/source/conf.py
21+
22+
# Optionally build your docs in additional formats such as PDF and ePub
23+
# formats:
24+
# - pdf
25+
# - epub
26+
27+
# Optional but recommended, declare the Python requirements required
28+
# to build your documentation
29+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
30+
python:
31+
install:
32+
- requirements: docs/requirements.txt

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Defining the exact version will make sure things don't break
2+
sphinx-book-theme==1.0.1
3+
# sphinx-pdj-theme==0.4.0
4+
myst-parser==2.0.0
5+
markdown-it-py==3.0.0
6+
sphinx-copybutton==0.5.2

docs/source/code.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# MailboxValidator VB.NET API
2+
3+
## SingleValidation Class
4+
```{py:class} SingleValidation(api_key)
5+
Configure MailboxValidator API key.
6+
7+
:param str api_key: (Required) MailboxValidator API key.
8+
```
9+
10+
```{py:function} ValidateEmailAsync(email_address)
11+
Validate whether an email address is a valid email or not.
12+
13+
:param str email_address: (Required) The email address.
14+
15+
:return: Returns the validation result in JSON object.
16+
:rtype: Object
17+
18+
**Successful Response Parameters**
19+
| Field Name | Description |
20+
|-----------|------------|
21+
| email_address | The input email address. |
22+
| base_email_address | The input email address after sanitizing the username of the dots (only Gmail) and [subaddressing](https://en.wikipedia.org/wiki/Email_address#Sub-addressing). |
23+
| domain | The domain of the email address. |
24+
| is_free | Whether the email address is from a free email provider like Gmail or Hotmail. Return values: true, false, null (null means not applicable) |
25+
| is_syntax | Whether the email address is syntactically correct. Return values: true, false |
26+
| is_domain | Whether the email address has a valid MX record in its DNS entries. Return values: true, false, null (null means not applicable) |
27+
| is_smtp | Whether the mail servers specified in the MX records are responding to connections. Return values: true, false, null (null means not applicable) |
28+
| is_verified | Whether the mail server confirms that the email address actually exist. Return values: true, false, null (null means not applicable) |
29+
| is_server_down | Whether the mail server is currently down or unresponsive. Return values: true, false, null (null means not applicable) |
30+
| is_greylisted | Whether the mail server employs greylisting where an email has to be sent a second time at a later time. Return values: true, false, null (null means not applicable) |
31+
| is_disposable | Whether the email address is a temporary one from a disposable email provider. Return values: true, false, null (null means not applicable) |
32+
| is_suppressed | Whether the email address is in our blacklist. Return values: true, false, null (null means not applicable) |
33+
| is_role | Whether the email address is a role-based email address like admin@example.net or webmaster@example.net. Return values: true, false, null (null means not applicable) |
34+
| is_high_risk | Whether the email address contains high risk keywords. Return values: true, false, null (null means not applicable) |
35+
| is_catchall | Whether the email address is a catch-all address. Return values: true, false, null (null means not applicable) |
36+
| is_dmarc_enforced | Whether the email domain is enforcing DMARC. Return values: true, false |
37+
| is_strict_spf | Whether the email domain is using strict SPF. Return values: true, false |
38+
| website_exist | Whether the email domain is a reachable website. Return values: true, false |
39+
| mailboxvalidator_score | Email address reputation score. Score > 0.70 means good; score > 0.40 means fair; score <= 0.40 means poor. |
40+
| time_taken | The time taken to get the results in seconds. |
41+
| status | Whether our system think the email address is valid based on all the previous fields. Return values: True, False |
42+
| credits_available | The number of credits left to perform validations. |
43+
44+
**Error Response Parameters**
45+
| Field Name | Description |
46+
|-----------|------------|
47+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
48+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
49+
50+
```
51+
52+
```{py:function} DisposableEmailAsync(email_address)
53+
Validate whether an email address is a disposable email or not.
54+
55+
:param str email_address: (Required) The email address.
56+
57+
:return: Returns the validation result in JSON object.
58+
:rtype: Object
59+
60+
**Successful Response Parameters**
61+
| Field Name | Description |
62+
|-----------|------------|
63+
| email_address | The input email address. |
64+
| is_disposable | Whether the email address is a temporary one from a disposable email provider. Return values: True, False |
65+
| credits_available | The number of credits left to perform validations. |
66+
67+
68+
**Error Response Parameters**
69+
| Field Name | Description |
70+
|-----------|------------|
71+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
72+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
73+
74+
```
75+
76+
```{py:function} FreeEmailAsync(email_address)
77+
Validate whether an email address is a free email or not.
78+
79+
:param str email_address: (Required) The email address.
80+
81+
:return: Returns the validation result in JSON object.
82+
:rtype: Object
83+
84+
**Successful Response Parameters**
85+
| Field Name | Description |
86+
|-----------|------------|
87+
| email_address | The input email address. |
88+
| is_free | Whether the email address is from a free email provider like Gmail or Hotmail. Return values: True, False |
89+
| credits_available | The number of credits left to perform validations. |
90+
91+
92+
**Error Response Parameters**
93+
| Field Name | Description |
94+
|-----------|------------|
95+
| error.error_code | The error code if there is any error. See error table in the [Error Codes](reference.md) section. |
96+
| error.error_message | The error message if there is any error. See error table in the [Error Codes](reference.md) section. |
97+
98+
```
99+

docs/source/conf.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
# Read https://www.sphinx-doc.org/en/master/usage/configuration.html for more options available
3+
4+
# import sphinx_pdj_theme
5+
6+
# -- Project information
7+
8+
project = 'MailboxValidator VB.NET'
9+
copyright = '2024, MailboxValidator'
10+
author = 'MailboxValidator'
11+
12+
release = '0.1.0'
13+
version = '0.1.0'
14+
15+
# -- General configuration
16+
17+
extensions = [
18+
'sphinx.ext.duration',
19+
'sphinx.ext.doctest',
20+
'myst_parser',
21+
'sphinx_copybutton',
22+
]
23+
24+
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
25+
26+
myst_enable_extensions = [
27+
"colon_fence",
28+
"deflist",
29+
"fieldlist",
30+
]
31+
32+
# https://myst-parser.readthedocs.io/en/latest/configuration.html#setting-html-metadata
33+
myst_html_meta = {
34+
"description": "MailboxValidator VB.NET module enable users to block disposal email, detect free email and validate if an email is valid.",
35+
"keywords": "MailboxValidator, Email Validation, disposable email, free email, VB.NET",
36+
"google-site-verification": "DeW6mXDyMnMt4i61ZJBNuoADPimo5266DKob7Z7d6i4",
37+
}
38+
39+
# templates_path = ['_templates']
40+
41+
# -- Options for HTML output
42+
43+
html_theme = 'sphinx_book_theme'
44+
# html_theme_path = [sphinx_pdj_theme.get_html_theme_path()]
45+
46+
# PDJ theme options, see the list of available options here: https://github.com/jucacrispim/sphinx_pdj_theme/blob/master/sphinx_pdj_theme/theme.conf
47+
html_theme_options = {
48+
"use_edit_page_button": False,
49+
"use_source_button": False,
50+
"use_issues_button": False,
51+
"use_download_button": False,
52+
"use_sidenotes": False,
53+
}
54+
55+
# The name of an image file (relative to this directory) to place at the top
56+
# of the sidebar.
57+
html_logo = 'images/mbv-logo-square-1200.png'
58+
59+
# Favicon
60+
html_favicon = 'images/favicon.ico'
61+
62+
html_title = "MailboxValidator VB.NET"
63+
64+
# html_baseurl = "https://ip2proxy-php.readthedocs.io/en/latest/"

docs/source/images/favicon.ico

7.23 KB
Binary file not shown.
31 KB
Loading

docs/source/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MailboxValidator VB.NET Libary
2+
==============================
3+
4+
This VB.NET 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+
13+
## Table of contents
14+
```{eval-rst}
15+
.. toctree::
16+
17+
self
18+
quickstart
19+
code
20+
reference
21+
```

docs/source/quickstart.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Quickstart
2+
3+
## Dependencies
4+
5+
An API key is required for this module to function.
6+
7+
Go to https://www.mailboxvalidator.com/plans#api to sign up for FREE API plan and you'll be given an API key.
8+
9+
## Compilation
10+
11+
Just open the solution file in Visual Studio 2022 or later and compile.
12+
13+
## Sample Codes
14+
15+
### Validate email
16+
17+
You can validate whether an email address is invalid or not as below:
18+
19+
```vbnet
20+
Imports Newtonsoft.Json
21+
22+
Module Program
23+
Sub Main(args As String())
24+
Dim apikey = "PASTE_YOUR_API_KEY_HERE"
25+
Dim email = "example@example.com"
26+
Dim mbv As New MailboxValidator.SingleValidation(apikey)
27+
28+
Dim mytask = mbv.ValidateEmailAsync(email) ' async API Call
29+
Dim myobj = mytask.Result
30+
31+
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)) ' to pretty-print the JSON
32+
33+
Console.WriteLine("email_address:" & myobj("email_address").ToString)
34+
Console.WriteLine("base_email_address:" & myobj("base_email_address").ToString)
35+
Console.WriteLine("domain:" & myobj("domain").ToString)
36+
Console.WriteLine("is_free:" & myobj("is_free").ToString)
37+
Console.WriteLine("is_syntax:" & myobj("is_syntax").ToString)
38+
Console.WriteLine("is_domain:" & myobj("is_domain").ToString)
39+
Console.WriteLine("is_smtp:" & myobj("is_smtp").ToString)
40+
Console.WriteLine("is_verified:" & myobj("is_verified").ToString)
41+
Console.WriteLine("is_server_down:" & myobj("is_server_down").ToString)
42+
Console.WriteLine("is_greylisted:" & myobj("is_greylisted").ToString)
43+
Console.WriteLine("is_disposable:" & myobj("is_disposable").ToString)
44+
Console.WriteLine("is_suppressed:" & myobj("is_suppressed").ToString)
45+
Console.WriteLine("is_role:" & myobj("is_role").ToString)
46+
Console.WriteLine("is_high_risk:" & myobj("is_high_risk").ToString)
47+
Console.WriteLine("is_catchall:" & myobj("is_catchall").ToString)
48+
Console.WriteLine("is_dmarc_enforced:" & myobj("is_dmarc_enforced").ToString)
49+
Console.WriteLine("is_strict_spf:" & myobj("is_strict_spf").ToString)
50+
Console.WriteLine("website_exist:" & myobj("website_exist").ToString)
51+
Console.WriteLine("mailboxvalidator_score:" & myobj("mailboxvalidator_score").ToString)
52+
Console.WriteLine("time_taken:" & myobj("time_taken").ToString)
53+
Console.WriteLine("status:" & myobj("status").ToString)
54+
Console.WriteLine("credits_available:" & myobj("credits_available").ToString)
55+
End Sub
56+
End Module
57+
```
58+
59+
### Check if an email is from a disposable email provider
60+
61+
You can validate whether an email address is disposable email address or not as below:
62+
63+
```vbnet
64+
Imports Newtonsoft.Json
65+
66+
Module Program
67+
Sub Main(args As String())
68+
Dim apikey = "PASTE_YOUR_API_KEY_HERE"
69+
Dim email = "example@example.com"
70+
Dim mbv As New MailboxValidator.SingleValidation(apikey)
71+
72+
Dim mytask = mbv.DisposableEmailAsync(email) ' async API Call
73+
Dim myobj = mytask.Result
74+
75+
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)) ' to pretty-print the JSON
76+
77+
Console.WriteLine("email_address:" & myobj("email_address").ToString)
78+
Console.WriteLine("is_disposable:" & myobj("is_disposable").ToString)
79+
Console.WriteLine("credits_available:" & myobj("credits_available").ToString)
80+
End Sub
81+
End Module
82+
```
83+
84+
### Check if an email is from a free email provider
85+
86+
You can validate whether an email address is free email address or not as below:
87+
88+
```vbnet
89+
Imports Newtonsoft.Json
90+
91+
Module Program
92+
Sub Main(args As String())
93+
Dim apikey = "PASTE_YOUR_API_KEY_HERE"
94+
Dim email = "example@example.com"
95+
Dim mbv As New MailboxValidator.SingleValidation(apikey)
96+
97+
Dim mytask = mbv.FreeEmailAsync(email) ' async API Call
98+
Dim myobj = mytask.Result
99+
100+
Console.WriteLine(JsonConvert.SerializeObject(myobj, Formatting.Indented)) ' to pretty-print the JSON
101+
102+
Console.WriteLine("email_address:" & myobj("email_address").ToString)
103+
Console.WriteLine("is_free:" & myobj("is_free").ToString)
104+
Console.WriteLine("credits_available:" & myobj("credits_available").ToString)
105+
End Sub
106+
End Module
107+
```

0 commit comments

Comments
 (0)