A simple CLI tool built with Go to verify email addresses by checking their format, domain validity, and reachability.
- 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.
- Go 1.18+
Clone the repository:
git clone https://github.com/ayushsarode/email-verifier.git
cd email-verifier/cli
Install dependencies:
go mod tidy
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!
email-verifier/
└── cli/
├── cmd/
│ ├── root.go
│ ├── verify.go
├── internal/
│ ├── validator_test.go
│ ├── validator.go
├── main.go
├── go.mod
├── go.sum
go run main.go verify --email=your-email@example.com
--email
or-e
: The email address to be verified.
Common errors handled:
- Invalid email format.
- Invalid domain without MX records.
- Unreachable email via SMTP.
Run unit tests with:
go test ./...
This project is licensed under the MIT License.
Feel free to submit issues or pull requests to enhance the project.