Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
build
dist
MANIFEST
*.egg-info
*.egg-info
magementleads.csv
pass.csv
fail.cssv
129 changes: 99 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,122 @@
==============
Validate_email
==============

Validate_email is a package for Python that check if an email is valid, properly formatted and really exists.

````markdown
# Validate Email Python Package

Validate_email is a lightweight Python package designed to verify if an email address is valid, properly formatted, and actually exists. It can also optionally check the associated website for the email's domain, ensuring comprehensive validation.

INSTALLATION
============
## Installation

First, you must do::
Install the core package via pip:

pip install validate_email
```bash
pip install validate_email
````

Extra
------
### Extra Dependencies

For check the domain mx and verify email exits you must have the `pyDNS` package installed::
For advanced features like checking domain MX records, verifying email existence, and website availability, install these additional packages:

pip install pyDNS
```bash
pip install pyDNS requests dnspython tqdm
```

These enable MX lookups, HTTP requests for websites, DNS resolution, and efficient multithreaded processing.

USAGE
=====
## Usage

Basic usage::
### Basic Validation

from validate_email import validate_email
is_valid = validate_email('[email protected]')
Check if an email is properly formatted and syntactically correct:

```python
from validate_email import validate_email_pipeline

Checking domain has SMTP Server
-------------------------------
status, reason = validate_email_pipeline('[email protected]')
print(status, reason) # Output: True, None (if valid)
```

Check if the host has SMTP Server::
### Check Domain SMTP Server

from validate_email import validate_email
is_valid = validate_email('[email protected]',check_mx=True)
Verify the email domain's SMTP server availability:

```python
from validate_email import validate_email_pipeline

Verify email exists
-------------------
status, reason = validate_email_pipeline('[email protected]', web='example.com')
print(status, reason)
```

Check if the host has SMTP Server and the email really exists::
### Full Verification

from validate_email import validate_email
is_valid = validate_email('[email protected]',verify=True)
Perform a complete check: email syntax, website availability, MX records, and optional SMTP RCPT verification:

```python
from validate_email import validate_email_pipeline

TODOs and BUGS
==============
See: http://github.com/syrusakbary/validate_email/issues
status, reason = validate_email_pipeline('[email protected]', web='www.example.com')
print(status, reason)
```

> Note: The package automatically prepends `https://` to domains like `www.example.com` for secure website checks.

### CSV Bulk Processing

Process large lists of emails from a CSV file. Your CSV should have these columns:

| Column | Description |
| ----------- | -------------------- |
| Email | The email address |
| Web Address | Optional website URL |

Run the bulk validation script:

```bash
python validate_email_pipeline.py
```

* Input: Prompt for your CSV filename.
* Output:

* `pass.csv`: Validated emails.
* `fail.csv`: Failed emails with detailed reasons.

> This feature uses multithreading for speed on large datasets.

## Features

* Email Syntax Validation: Ensures proper formatting.
* Website Availability Check: Tests if the domain's website is reachable.
* MX Records Verification: Confirms the domain has valid mail servers.
* SMTP RCPT Check: Optional deep verification to see if the email truly exists.
* Multithreaded Processing: Handles bulk validations efficiently.
* Smart Heuristics: Combines all checks for reliable decisions.

## Example CSV Input

```csv
Email,Web Address
[email protected],www.google.com
[email protected],example.com
[email protected],www.microsoft.com
```

## Contribution

I (Reabot6) have added enhancements and improvements to the original project.
All contributions must respect the original license:

* Fork the repository.
* Add new features, fix bugs, or refine validation logic.
* Submit a Pull Request with clear descriptions.

> Original project by [Syrus Akbary](https://github.com/syrusakbary/validate_email)

## License

This project is licensed under the MIT License. The original code is © Syrus Akbary. My contributions are © Reabot6.

## Contact

GitHub: [reabot6](https://github.com/reabot6)
Website: [reabotportfolios.vercel.app](https://reabotportfolios.vercel.app)
Loading