feat: Add electron-packager and GitHub Actions for desktop builds

- Add electron-packager as alternative build tool
- Create GitHub Actions workflow for automated Windows builds
- Update .gitignore to exclude dist folder
- Add comprehensive README with installation and usage instructions
- Successfully built Windows executable (210MB)
This commit is contained in:
Danijel Micic
2025-12-15 18:27:15 +11:00
parent cc3c27b674
commit 6857d33319
5 changed files with 1033 additions and 392 deletions

53
.github/workflows/build-desktop.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Build Desktop App
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build with electron-builder
run: npm run build
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: |
dist/*.exe
dist/*.zip
retention-days: 30
- name: Create Release (on tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.exe
dist/*.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
node_modules
dist
.DS_Store
*.log
.env

481
README.md
View File

@@ -1,421 +1,124 @@
# Advanced SMTP Tester
![Advanced SMTP Tester Banner](docs/readme_banner.png)
A powerful desktop application for testing SMTP configurations with support for multiple providers, dark mode, test history, and enhanced error messages.
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Node.js](https://img.shields.io/badge/node-%3E%3D14.0.0-brightgreen)](https://nodejs.org/)
[![GitHub](https://img.shields.io/badge/GitHub-DeNNiiInc%2FAdvanced--Smtp--Tester-181717?logo=github)](https://github.com/DeNNiiInc/Advanced-Smtp-Tester)
## Features
A professional, feature-rich SMTP testing utility with a modern web interface. Test your email server configurations, troubleshoot delivery issues, and discover optimal SMTP settings automatically.
### 🎨 User Interface
- **Dark/Light Mode** - Toggle between themes with persistence
- **Configuration Presets** - Quick-load for Office 365, Gmail, SendGrid, Mailgun, Amazon SES
- **Test History** - Last 50 tests with click-to-load
- **Enhanced Errors** - Helpful troubleshooting tips for common issues
---
### 🖥️ Desktop Application
- **Native Windows App** - Runs in its own window (no browser needed)
- **System Tray** - Minimize to tray, quick access
- **Menu Bar** - Full application menu
- **Auto-Start Server** - Express server starts automatically
## 📋 Table of Contents
### 📧 SMTP Testing
- **Multiple Encryption** - STARTTLS, SSL/TLS, Unencrypted
- **Auto-Discovery** - Test multiple port/encryption combinations
- **Beautiful Emails** - Professional HTML test emails
- **Detailed Results** - Full response logs and error messages
- [Features](#-features)
- [Screenshots](#-screenshots)
- [Installation](#-installation)
- [Usage](#-usage)
- [Configuration Examples](#-configuration-examples)
- [API Endpoints](#-api-endpoints)
- [Security Notes](#-security-notes)
- [Troubleshooting](#-troubleshooting)
- [Contributing](#-contributing)
- [License](#-license)
## Installation
---
### Desktop App (Windows)
1. Download the latest release from [Releases](https://github.com/DeNNiiInc/Advanced-Smtp-Tester/releases)
2. Extract the ZIP file
3. Run `Advanced-SMTP-Tester.exe`
## ✨ Features
### Web Version
```bash
npm install
npm start
```
Open `http://localhost:3000` in your browser.
### 🔐 Comprehensive SMTP Support
- **Multiple Encryption Methods**: STARTTLS, SSL/TLS, and unencrypted connections
- **Common Ports**: Pre-configured support for ports 587, 465, 25, and 2525
- **Custom Configurations**: Flexible settings for any SMTP server
### Electron Development
```bash
npm install
npm run electron
```
### 🔍 Auto-Discovery Testing
- Automatically tests multiple SMTP configurations
- Intelligently tries common port and encryption combinations
- Reports all successful configurations
- Sends test emails for each working setup
## Building from Source
### 📧 Email Testing
- Sends styled HTML test emails
- Includes configuration details in email body
- Password included for verification (configurable)
- From/To address customization
### Web Version
```bash
npm install
npm start
```
### 🎨 Modern User Interface
- Clean, intuitive design
- Responsive layout for all devices
- Real-time status updates
- Animated background effects
- Dark theme optimized for extended use
### Desktop App
```bash
npm install
npm run build
```
### 🛡️ Security Features
- Password visibility toggle
- Secure encryption options
- Warning notifications for sensitive data
- No credential storage
Or use electron-packager:
```bash
npx electron-packager . "Advanced-SMTP-Tester" --platform=win32 --arch=x64 --out=dist --overwrite
```
---
## <20> How It Works
![Workflow Diagram](docs/workflow_diagram.png)
The SMTP testing process is simple and straightforward:
1. **Enter Credentials** - Provide your SMTP server details and authentication
2. **Connect to Server** - Application establishes secure connection to SMTP server
3. **Send Test Email** - Formatted test email is sent through the configured server
4. **View Results** - Detailed success/failure information displayed in real-time
---
## <20>📸 Screenshots
### Main Interface
![SMTP Tester Interface](docs/smtp_tester_interface.png)
*Clean, modern interface for SMTP configuration*
### Form Example
![Filled Form Example](docs/filled_form_example.png)
*Example configuration with Gmail SMTP settings*
---
## 🚀 Installation
### Prerequisites
- **Node.js** (v14.0.0 or higher)
- **npm** (comes with Node.js)
## Usage
### Quick Start
1. Select a preset (e.g., "Microsoft Office 365")
2. Enter your credentials
3. Enter recipient email
4. Click "Test Configuration & Send Email"
1. **Clone the repository**
```bash
git clone https://github.com/DeNNiiInc/Advanced-Smtp-Tester.git
cd Advanced-Smtp-Tester
```
### Configuration Presets
- **Office 365**: `smtp.office365.com:587` (STARTTLS)
- **Gmail**: `smtp.gmail.com:587` (STARTTLS)
- **SendGrid**: `smtp.sendgrid.net:587` (STARTTLS)
- **Mailgun**: `smtp.mailgun.org:587` (STARTTLS)
- **Amazon SES**: `email-smtp.us-east-1.amazonaws.com:587` (STARTTLS)
2. **Install dependencies**
```bash
npm install
```
### Auto-Discovery
Click "Auto Discovery Test" to automatically test multiple port/encryption combinations.
3. **Start the server**
```bash
npm start
```
4. **Open in browser**
```
http://localhost:3000
```
The application will be running on port 3000 by default.
---
## 📖 Usage
### Manual Configuration Test
1. **Enter SMTP Server Details**
- **Host**: Your SMTP server address (e.g., `smtp.gmail.com`)
- **Port**: SMTP port number (e.g., `587` for STARTTLS)
- **Encryption**: Choose appropriate encryption method
- STARTTLS (587/25) - Most common for modern servers
- SSL/TLS (465) - Legacy secure connection
- Unencrypted - Not recommended for production
2. **Provide Authentication**
- **Username/Email**: Your email address or username
- **Password**: Account password or app-specific password
3. **Configure Email Details**
- **From Address** (Optional): Defaults to username if not specified
- **To Address**: Recipient email for the test
4. **Run Test**
- Click **"Test Configuration & Send Email"**
- Wait for results (typically 5-15 seconds)
- Check the results panel for success or error messages
### Auto-Discovery Test
For when you're not sure which configuration to use:
1. **Enter Basic Details**
- SMTP Host
- Username/Password
- To Address
2. **Click "🔍 Auto Discovery Test"**
3. **Review Results**
- The tool will test multiple port/encryption combinations
- Successful configurations will send test emails
- All working setups will be reported
---
## 🔧 Configuration Examples
![Quick Reference Card](docs/quick_reference.png)
*Quick reference for popular email providers*
### Gmail
## Development
### Project Structure
```
Host: smtp.gmail.com
Port: 587
Encryption: STARTTLS (587/25)
Username: your-email@gmail.com
Password: your-app-password
Advanced-Smtp-Tester/
├── electron-main.js # Electron entry point
├── server.js # Express server
├── index.html # Main UI
├── public/
│ ├── db.js # IndexedDB wrapper
│ ├── script.js # Frontend logic
│ ├── styles.css # Styling
│ └── Logo.png # App icon
└── .github/
└── workflows/
└── build-desktop.yml # Automated builds
```
> **Note**: Gmail requires [App Passwords](https://support.google.com/accounts/answer/185833) when 2FA is enabled.
### Scripts
- `npm start` - Start web server
- `npm run electron` - Run desktop app
- `npm run build` - Build Windows installer
- `npm run build:dir` - Build unpacked directory
### Outlook/Office 365
## Technologies
```
Host: smtp.office365.com
Port: 587
Encryption: STARTTLS (587/25)
Username: your-email@outlook.com
Password: your-password
```
- **Backend**: Node.js, Express, Nodemailer
- **Frontend**: Vanilla JavaScript, IndexedDB
- **Desktop**: Electron
- **Build**: electron-builder, electron-packager
### Yahoo Mail
## License
```
Host: smtp.mail.yahoo.com
Port: 587
Encryption: STARTTLS (587/25)
Username: your-email@yahoo.com
Password: your-app-password
```
ISC
### Custom SMTP Server
## Author
```
Host: mail.yourdomain.com
Port: 587 (or 465, 25, 2525)
Encryption: Based on your server config
Username: user@yourdomain.com
Password: your-password
```
Beyond Cloud Technology
---
## Links
## 🔌 API Endpoints
### POST `/api/test-smtp`
Test a specific SMTP configuration and send an email.
**Request Body:**
```json
{
"host": "smtp.gmail.com",
"port": 587,
"secure": "false",
"user": "your-email@gmail.com",
"pass": "your-password",
"from": "sender@example.com",
"to": "recipient@example.com"
}
```
**Response:**
```json
{
"success": true,
"message": "Email sent successfully!",
"info": {
"accepted": ["recipient@example.com"],
"messageId": "<message-id>"
}
}
```
### POST `/api/auto-test-smtp`
Automatically test multiple SMTP configurations.
**Request Body:**
```json
{
"host": "smtp.gmail.com",
"user": "your-email@gmail.com",
"pass": "your-password",
"to": "recipient@example.com"
}
```
**Response:**
```json
{
"success": true,
"results": [
{
"port": 587,
"secure": "false",
"status": "success",
"message": "Email sent successfully!"
}
]
}
```
---
## 🔒 Security Notes
> [!WARNING]
> **Password Transmission**
> By default, the test email includes the password used for testing in the email body. This is intentional for verification purposes but should be used carefully.
### Best Practices
1. **Use App-Specific Passwords**
- Don't use your main account password
- Create dedicated app passwords for testing
2. **Avoid Public Networks**
- Don't test on public WiFi
- Use VPN when possible
3. **Delete Test Emails**
- Remove test emails containing passwords
- Clear sent items after testing
4. **Local Hosting Only**
- By default, runs on localhost only
- Do not expose to the internet without proper security
5. **HTTPS in Production**
- Use reverse proxy (nginx, Apache) for HTTPS
- Never send credentials over unencrypted connections
---
## 🐛 Troubleshooting
### Common Issues
#### "Connection timeout" or "ETIMEDOUT"
- **Cause**: Firewall blocking SMTP ports
- **Solution**:
- Check firewall settings
- Try different ports (587, 465, 25)
- Contact your hosting provider
#### "Invalid login" or "Authentication failed"
- **Cause**: Incorrect credentials or security settings
- **Solution**:
- Verify username and password
- Use app-specific passwords
- Enable "Less secure apps" (not recommended)
- Check for 2FA requirements
#### "Self-signed certificate" errors
- **Cause**: Server using self-signed SSL certificate
- **Solution**:
- Try unencrypted connection for testing
- Update to use proper SSL certificates
#### Gmail "Username and Password not accepted"
- **Cause**: Gmail security blocks
- **Solution**:
- Enable 2-Step Verification
- Create App Password
- Use the App Password instead of account password
### Debug Mode
Check the browser console (F12) for detailed error messages. Server logs will show in the terminal where you ran `npm start`.
---
## 🤝 Contributing
Contributions are welcome! Please follow these guidelines:
1. **Fork the repository**
2. **Create a feature branch**
```bash
git checkout -b feature/your-feature-name
```
3. **Commit your changes**
```bash
git commit -m "Add your feature description"
```
4. **Push to your branch**
```bash
git push origin feature/your-feature-name
```
5. **Open a Pull Request**
### Development Setup
```bash
# Install dependencies
npm install
# Start development server
npm start
# The server runs with auto-reload enabled
```
---
## 📄 License
This project is licensed under the **GNU General Public License v3.0**.
```
Advanced SMTP Tester - Professional Email Configuration Testing
Copyright (C) 2025 Beyond Cloud Technology
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
```
See the [LICENSE](LICENSE) file for full details.
---
## 🙏 Acknowledgments
- Built with [Node.js](https://nodejs.org/)
- Email functionality powered by [Nodemailer](https://nodemailer.com/)
- UI inspired by modern web design principles
- Developed by [Beyond Cloud Technology](https://github.com/DeNNiiInc)
---
## 📞 Support
- **Issues**: [GitHub Issues](https://github.com/DeNNiiInc/Advanced-Smtp-Tester/issues)
- **YouTube**: [@beyondcloudtechnology](https://www.youtube.com/@beyondcloudtechnology)
- **GitHub**: [@DeNNiiInc](https://github.com/DeNNiiInc)
---
<div align="center">
**Made with ❤️ by Beyond Cloud Technology**
[⭐ Star this repo](https://github.com/DeNNiiInc/Advanced-Smtp-Tester) | [🐛 Report Bug](https://github.com/DeNNiiInc/Advanced-Smtp-Tester/issues) | [✨ Request Feature](https://github.com/DeNNiiInc/Advanced-Smtp-Tester/issues)
</div>
- [GitHub Repository](https://github.com/DeNNiiInc/Advanced-Smtp-Tester)
- [YouTube Channel](https://www.youtube.com/@beyondcloudtechnology)

883
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -35,7 +35,8 @@
},
"devDependencies": {
"electron": "^39.2.7",
"electron-builder": "^26.0.12"
"electron-builder": "^26.0.12",
"electron-packager": "^17.1.2"
},
"build": {
"appId": "com.beyondcloud.smtptester",
@@ -80,4 +81,4 @@
"artifactName": "${productName}-${version}-portable.${ext}"
}
}
}
}