✅ A lightweight, interactive Go program for validating and testing SMTP (Simple Mail Transfer Protocol) account credentials. This tool is designed to help developers and sysadmins verify email server configurations, test authentication, and send test emails — all from the terminal.
- 🔐 Validate SMTP credentials using TLS (port 465) or STARTTLS (port 587)
- 📤 Send test emails to verify full SMTP functionality
- 📄 Load multiple SMTP configurations from a JSON file
- 🧑💻 Interactive terminal interface with menu-driven options
- 🧪 Logs full connection and authentication process
- 🛡️ Secure: avoids committing sensitive credentials by ignoring
/jsondirectory
smtp-validator/
├── go.mod
├── main.go
├── json/ # Ignored by Git (contains sensitive configs)
│ └── smtp_config.json # Your actual SMTP credentials (not committed)
├── smtp/
│ ├── json.go # Loads SMTP configs from JSON
│ ├── send.go # Sends test emails
│ ├── validate.go # Validates SMTP credentials
│ └── types.go # Defines SMTPConfig struct
├── terminal/
│ └── home.go # Interactive terminal UI
├── README.md
└── LICENSE
Create a file at json/smtp_config.json with the following structure:
[
{
"host": "smtp.gmail.com",
"port": 587,
"user": "your-email@gmail.com",
"pass": "your-password"
},
{
"host": "smtp.mail.yahoo.com",
"port": 465,
"user": "your-email@yahoo.com",
"pass": "your-password"
}
]
⚠️ This file is ignored by Git. Do not commit real credentials.
-
Clone the repository and navigate into it:
git clone https://github.com/davieid/smtpTest.git cd smtpTest -
Initialize Go module (if not already):
go mod tidy
-
Run the program:
go run main.go
-
Follow the interactive prompts:
📁 Enter path to your SMTP JSON config file: json/smtp_config.json 📬 Welcome to SMTP Validator Please choose an option: 1. View Configuration 2. Validate SMTP Credentials 3. Validate and Send Test Email 4. Exit
- Language: Go
- Standard libraries:
net/smtp,crypto/tls,encoding/json,bufio,os,fmt,log
- Add support for OAuth2 authentication
- Export results to a log file
- Add CLI flags for headless operation
- Support for port 25 with STARTTLS fallback
This project is licensed under the MIT License. However:
Commercial use of this software or its derivatives requires prior written permission from the author. Attribution is required in all distributions.
Contributions are welcome! Feel free to fork the repo, submit pull requests, or open issues for bugs and feature requests.
Bolaji
Built in 🆖 with ❤️ and Go.
If you find SMTP Validator helpful and want to support its continued development and feature updates, consider donating. Your support helps keep the project alive and evolving. 🙌
💸 Donate with Bitcoin
bc1q6qpm84aarlmr35aceyavq74pj40q7k7n9x9p97
Just copy the address above and send any amount you’d like. Every satoshi counts!