illuma-law/healthcheck-mail

Focused mail health check for Spatie's Laravel Health package.

Maintainers

Package info

github.com/illuma-law/healthcheck-mail

pkg:composer/illuma-law/healthcheck-mail

Fund package maintenance!

illuma-law

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.2 2026-04-20 18:47 UTC

This package is auto-updated.

Last update: 2026-04-20 18:49:54 UTC


README

Tests Packagist License Latest Stable Version

A focused mail health check for Spatie's Laravel Health package.

This package provides a simple, direct health check to verify that your application's SMTP server is reachable and accepting TCP connections.

Features

  • Connectivity Check: Verifies that your Laravel application can successfully connect to the configured SMTP host and port.
  • Latency Monitoring: Measures the response time of the SMTP connection.
  • Smart Skipping: Automatically skips the check if the default mailer is set to log, array, fail, or null.

Installation

Require this package with composer:

composer require illuma-law/healthcheck-mail

Usage & Integration

Register the check inside your application's health service provider (e.g. AppServiceProvider or a dedicated HealthServiceProvider), alongside your other Spatie Laravel Health checks:

Basic Registration

use IllumaLaw\HealthCheckMail\MailConnectivityCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    MailConnectivityCheck::new(),
]);

Expected Result States

The check interacts with the Spatie Health dashboard and JSON endpoints using these states:

  • Ok: SMTP server is reachable and accepting connections.
  • Skipped: The default mailer is not an SMTP-based driver.
  • Failed: SMTP server was unreachable, or the mailer configuration is missing.

Testing

Run the test suite:

composer test

License

The MIT License (MIT). Please see License File for more information.