eii / laravel-email-tester
Command-line email delivery tester for Laravel applications.
Requires
- php: ^8.2
- illuminate/console: ^12.0|^13.0
- illuminate/log: ^12.0|^13.0
- illuminate/mail: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Send a synchronous test email from the command line to verify that a Laravel application's mail delivery is working.
Requirements
- PHP ^8.2
- Laravel ^12 or ^13
Installation
Install the package using Composer:
composer require eii/laravel-email-tester
Laravel will discover the service provider automatically.
Configuration
Publish the package configuration:
php artisan vendor:publish --tag=mail-test-config
Available environment variables:
MAIL_TEST_TO=you@example.com MAIL_TEST_FROM=no-reply@example.com MAIL_TEST_SUBJECT="Mail delivery test" MAIL_TEST_MAILER=smtp
If MAIL_TEST_TO is not set, the command falls back to MAIL_FROM_ADDRESS.
Usage
Send a test email:
php artisan mail:test
Send to a specific address:
php artisan mail:test --to=you@example.com
Show configuration details before sending:
php artisan mail:test --to=you@example.com --debug
Use a specific mailer:
php artisan mail:test --to=you@example.com --mailer=smtp
Custom subject and body:
php artisan mail:test --to=you@example.com --subject="Mail check" --body="This is a custom test"
Output
Successful delivery returns exit code 0.
Failed delivery returns exit code 1 and logs the error to Laravel's default log channel.
License
This package is open-sourced software licensed under the MIT license.