Skip to content

ayushsarode/email-verifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Email Verifier CLI

A simple CLI tool built with Go to verify email addresses by checking their format, domain validity, and reachability.

Features

  • Validate email format using regex.
  • Check if the email domain has valid MX records.
  • Verify the reachability of the email via SMTP.
  • Interactive CLI using Bubble Tea.

Prerequisites

  • Go 1.18+

Installation

Clone the repository:

git clone https://github.com/ayushsarode/email-verifier.git
cd email-verifier/cli

Install dependencies:

go mod tidy

Usage

Run the CLI tool:

go run main.go verify --email your-email@example.com

Example output:

[1/3] Checking email format...
[2/3] Checking domain validity...
[3/3] Checking email reachability...
✅ Email your-email@example.com is valid and reachable!

Project Structure

email-verifier/
  └── cli/
      ├── cmd/
      │   ├── root.go
      │   ├── verify.go
      ├── internal/
      │   ├── validator_test.go
      │   ├── validator.go
      ├── main.go
      ├── go.mod
      ├── go.sum

Commands

Verify an email

go run main.go verify --email=your-email@example.com

Flags

  • --email or -e: The email address to be verified.

Error Handling

Common errors handled:

  • Invalid email format.
  • Invalid domain without MX records.
  • Unreachable email via SMTP.

Testing

Run unit tests with:

go test ./...

License

This project is licensed under the MIT License.

Contribution

Feel free to submit issues or pull requests to enhance the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages