A future-proof, enterprise-grade PHP command-line tool built on Symfony 7.4 LTS and PHPMailer. It is architected to deliver messages securely via credential-free, IP-whitelisted SMTP relays, with fallback environment profiles for quick local container evaluation.
- Symfony 7.4 LTS Engine: Built with modern structured command handlers, full PHP type safety (
declare(strict_types=1)), and zero deprecated hooks. - DDEV / Mailpit Ready: Automatically detects local DDEV containers, self-adjusts network ports, and bypasses local TLS handshake enforcement natively.
- Failover Resilience: Automatically attempts exactly one delivery retry if the initial SMTP connection breaks.
- Interactive Prompts: Includes an input-safe verification confirmation layout before pushing data packets.
- Live Progress Animation: Provides a real-time tracking bar for underlying infrastructure steps.
- Comprehensive Logging: Full verbose SMTP transport diagnostics are printed directly to the console by default and appended cleanly to an isolated text log.
- PHP 8.4 or higher
- Composer installed locally
- Access to an IP-whitelisted SMTP server requiring no credentials (or local DDEV)
-
Navigate to your local project workspace directory:
cd your-project-folder -
Install dependencies utilizing strict version enforcement:
composer install
-
Initialize environment settings:
cp .env.example .env
-
Adjust the target server credentials inside
.envto match your infrastructure variables.
This app includes native auto-detection for DDEV container ecosystems. To test completely offline:
- Update your local
.envvariables to route directly through the DDEV internal loopback network:SMTP_HOST=localhost SMTP_PORT=1025
- Execute the script natively inside your active web service container container:
ddev exec php send.php - View the intercepted formatted text results inside the Mailpit interface:
ddev mailpit
Run the utility file with your system's native runtime binary:
php send.phpAll raw connection sequences are parsed dynamically and written to /smtp_delivery.log upon completion to protect the execution context from terminal output clutter.
├── .env # Environment values (Protected via .gitignore)
├── .env.example # Non-sensitive structure template for staging
├── .gitignore # Keeps variables, vendor libraries, and logs untracked
├── composer.json # Strict version locking (Symfony 7.4 LTS, PHP 8.4+)
├── send.php # Modern type-safe application runner execution entry
└── smtp_delivery.log # Append-only transport tracking audit record