-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from mailsac/add_email_validation
Add email validation
- Loading branch information
Showing
8 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file instructs readthedocs to include these extensions in the build. | ||
https://github.com/djungelorm/sphinx-tabs/releases/download/v1.1.13/sphinx-tabs-1.1.13.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
curl -H 'Mailsac-Key: YOUR_API_KEY_HERE' https://mailsac.com/api/validations/addresses/jimmy@mailsac.com | ||
|
||
# Output from curl | ||
{ | ||
"email": "jimmy@mailsac.com", | ||
"domain": "mailsac.com", | ||
"isValidFormat": true, | ||
"local": "jimmy", | ||
"isDisposable": true, | ||
"disposableDomains": [ | ||
"ledoktre.com", | ||
"mailsac.com", | ||
"totalvista.com", | ||
"slothmail.net" | ||
], | ||
"aliases": [ | ||
"ledoktre.com", | ||
"mailsac.com", | ||
"totalvista.com", | ||
"52.41.136.113", | ||
"slothmail.net", | ||
"aiwa.fm", | ||
"tztmax.com", | ||
"cs.msdc.co", | ||
"zeie.xyz", | ||
"yinpinpin.club", | ||
"jadeant.top", | ||
"dylans.email", | ||
"msdc.co" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _doc_email_validation: | ||
|
||
.. _Mailsac website: https://mailsac.com/email-validation | ||
|
||
Email Validation | ||
================ | ||
|
||
Email validation confirms that the provided email address is in a valid format | ||
and the email address is not associated with a disposable email service. | ||
Validations can be done using the `Mailsac website`_ or REST API. | ||
|
||
Additional information about the REST API endpoint for Email Validation | ||
is available in the `REST API Documentation | ||
<https://mailsac.com/docs/api/#email-validations-api>`_. The REST API endpoint | ||
supports bulk validation of up to 50 email addresses. | ||
|
||
Examples | ||
-------- | ||
|
||
.. tabs:: | ||
.. tab:: Mailsac Website | ||
|
||
.. figure:: website_email_validation.gif | ||
|
||
Email validation using the `Mailsac website`_ | ||
|
||
.. tab:: curl | ||
|
||
.. literalinclude:: curl_email_validation.txt | ||
:language: bash | ||
:caption: Validate email address | ||
|
||
.. tab:: Node.js Javascript | ||
|
||
.. literalinclude:: nodejs_email_validation.js | ||
:language: javascript | ||
:caption: Validate email address | ||
|
||
.. tab:: Python | ||
|
||
.. literalinclude:: python_email_validation.py | ||
:language: python | ||
:caption: Validate email address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const superagent = require('superagent') | ||
|
||
superagent | ||
.get('https://mailsac.com/api/validations/addresses/jimmy@mailsac.com') | ||
.set('Mailsac-Key', 'YOUR_API_KEY_HERE') | ||
.then((validation) => { | ||
console.log(validation.body) | ||
}) | ||
.catch(err => { | ||
console.log(err.message) | ||
}) | ||
/* | ||
{ | ||
email: 'jimmy@mailsac.com', | ||
domain: 'mailsac.com', | ||
isValidFormat: true, | ||
local: 'jimmy', | ||
isDisposable: true, | ||
disposableDomains: [ 'ledoktre.com', 'mailsac.com', 'totalvista.com', 'slothmail.net' ], | ||
aliases: [ | ||
'ledoktre.com', 'mailsac.com', | ||
'totalvista.com', '52.41.136.113', | ||
'slothmail.net', 'aiwa.fm', | ||
'tztmax.com', 'cs.msdc.co', | ||
'zeie.xyz', 'yinpinpin.club', | ||
'jadeant.top', 'dylans.email', | ||
'msdc.co' | ||
] | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import requests | ||
from pprint import pprint | ||
|
||
headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'} | ||
url = 'https://mailsac.com/api/validations/addresses/jimmy@mailsac.com' | ||
|
||
r = requests.get(url, headers=headers) | ||
pprint(r.json()) | ||
""" | ||
{'aliases': ['ledoktre.com', | ||
'totalvista.com', | ||
'52.41.136.113', | ||
'mailsac.com', | ||
'slothmail.net', | ||
'tztmax.com', | ||
'aiwa.fm', | ||
'zeie.xyz', | ||
'yinpinpin.club', | ||
'beautyoa.com', | ||
'lqpakswoowkw729292929292929.msdc.co'], | ||
'disposableDomains': ['ledoktre.com', | ||
'totalvista.com', | ||
'mailsac.com', | ||
'slothmail.net'], | ||
'domain': 'mailsac.com', | ||
'email': 'jimmy@mailsac.com', | ||
'isDisposable': True, | ||
'isValidFormat': True, | ||
'local': 'jimmy'} | ||
"""" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.