Search by

illuma-law / healthcheck-mail

miguelenes

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!

illuma-law

Statistics

Installs: 64

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.1.5 2026-10-23 13:39 UTC

README

Tests Latest Version License

SMTP connection health check illustration

A Laravel Health check that tests whether your configured SMTP host accepts a TCP connection.

Requirements

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: when true, 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.