illuma-law / healthcheck-mail
Focused mail health check for Spatie's Laravel Health package.
Package info
github.com/eloquage/healthcheck-mail
Language:Blade
pkg:composer/illuma-law/healthcheck-mail
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/contracts: ^12.0||^13.0
- illuminate/database: ^12.0||^13.0
- illuminate/support: ^12.0||^13.0
- spatie/laravel-health: ^1.39
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- mrpunyapal/peststan: ^0.2.12
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.1.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 13:39:41 UTC
README
A Laravel Health check that tests whether your configured SMTP host accepts a TCP connection.
Requirements
- PHP 8.3 or later
- Laravel 12 or 13
- Spatie Laravel Health
Install
composer require illuma-law/healthcheck-mail
Configure
Use an SMTP mailer in your Laravel mail configuration, for example:
MAIL_MAILER=smtp MAIL_HOST=smtp.example.com MAIL_PORT=587
The check skips non-SMTP transports such as log and ses. Publish its settings if you need to change the defaults:
php artisan vendor:publish --tag=healthcheck-mail-config
In config/healthcheck-mail.php:
required: whentrue, missing or unreachable SMTP configuration fails the check; otherwise it warns. Default:false.timeout_seconds: connection timeout in seconds. Default:3.
Environment variables are HEALTH_MAIL_REQUIRED and HEALTH_MAIL_TIMEOUT_SECONDS.
Use
Register the check with your Laravel Health checks:
use IllumaLaw\HealthCheckMail\MailConnectivityCheck; use Spatie\Health\Facades\Health; Health::checks([ MailConnectivityCheck::new(), ]);
The probe opens and closes a TCP connection. It does not test SMTP authentication, TLS negotiation, server greeting, or email delivery. A successful result confirms that the configured host and port accepted the connection.
Tests
composer install
composer test
composer analyse
License
MIT. See LICENSE.md.
