PHPackages                             mortensen/smtp-resend-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mortensen/smtp-resend-monitor

ActiveWordpress-muplugin[Logging &amp; Monitoring](/categories/logging)

mortensen/smtp-resend-monitor
=============================

WordPress mu-plugin that monitors SMTP failures and sends alerts via Resend HTTP API.

v1.0.5(3mo ago)023MITPHPPHP &gt;=8.0

Since Apr 17Pushed 3mo agoCompare

[ Source](https://github.com/we-are-mortensen/smtp-resend-monitor)[ Packagist](https://packagist.org/packages/mortensen/smtp-resend-monitor)[ RSS](/packages/mortensen-smtp-resend-monitor/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

SMTP Resend Monitor
===================

[](#smtp-resend-monitor)

WordPress mu-plugin that monitors SMTP failures and sends alerts via [Resend](https://resend.com) HTTP API.

The Problem
-----------

[](#the-problem)

When SMTP fails on a WordPress site, there is no way to be notified — because the notification mechanism (email) is itself broken. Sites can go months with broken SMTP until someone reports that forms aren't working.

How It Works
------------

[](#how-it-works)

1. **Real-time detection**: Hooks into `wp_mail_failed` to catch SMTP failures as they happen
2. **Proactive health-check**: Sends a test email every 24 hours via WP-Cron — if it fails, you get an alert
3. **Alert via HTTP**: Bypasses the broken SMTP entirely by sending alerts through Resend's HTTP API
4. **Cooldown**: Maximum 1 alert per 6 hours per site to prevent spam

Works with any SMTP setup: WP Mail SMTP plugin, roots/acorn-mail, or native WordPress.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0
- WordPress
- A [Resend](https://resend.com) account with a verified domain

Installation
------------

[](#installation)

```
composer require mortensen/smtp-resend-monitor
```

The package type is `wordpress-muplugin`, so Composer places it automatically in `mu-plugins/`.

Configuration
-------------

[](#configuration)

Add these variables to your `.env` file (Bedrock) or define them in `wp-config.php`:

VariableRequiredDescription`SMTP_MONITOR_RESEND_API_KEY`**Yes**Your Resend API key`SMTP_MONITOR_ALERT_TO`**Yes**Alert recipient email`SMTP_MONITOR_ALERT_FROM`**Yes**Alert sender email (must be from a verified Resend domain)### Bedrock (.env)

[](#bedrock-env)

```
SMTP_MONITOR_RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SMTP_MONITOR_ALERT_TO=dev@mortensen.cat
SMTP_MONITOR_ALERT_FROM=no-reply@mortensen.cat
```

### wp-config.php

[](#wp-configphp)

```
define('SMTP_MONITOR_RESEND_API_KEY', 're_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
define('SMTP_MONITOR_ALERT_TO', 'dev@mortensen.cat');
define('SMTP_MONITOR_ALERT_FROM', 'no-reply@mortensen.cat');
```

How It Detects Failures
-----------------------

[](#how-it-detects-failures)

### Real-time (`wp_mail_failed`)

[](#real-time-wp_mail_failed)

Every time `wp_mail()` fails, WordPress fires the `wp_mail_failed` action with a `WP_Error` object. This plugin hooks into it and sends an alert via Resend's HTTP API.

### Health-check (WP-Cron)

[](#health-check-wp-cron)

Every 24 hours, the plugin sends a test email via `wp_mail()` to the site's admin email. If the send fails, it triggers an alert. This catches silent failures where no user activity triggers `wp_mail()`.

Alert Email
-----------

[](#alert-email)

You receive an email with:

- **Site name** and **URL**
- **Error message** from WordPress
- **Detection type**: "Real-time" or "Health-check"
- **Timestamp**

Cooldown
--------

[](#cooldown)

To prevent alert spam (e.g., a form being submitted repeatedly while SMTP is broken), only 1 alert is sent per 6 hours per site.

Behavior When Not Configured
----------------------------

[](#behavior-when-not-configured)

If `SMTP_MONITOR_RESEND_API_KEY` is not set, the plugin does nothing — no errors, no warnings, no performance impact.

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance81

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

98d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3299672?v=4)[Frederik Mortensen](/maintainers/mortensen)[@mortensen](https://github.com/mortensen)

---

Top Contributors

[![adrianmomorales](https://avatars.githubusercontent.com/u/7737385?v=4)](https://github.com/adrianmomorales "adrianmomorales (6 commits)")

### Embed Badge

![Health badge](/badges/mortensen-smtp-resend-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/mortensen-smtp-resend-monitor/health.svg)](https://phpackages.com/packages/mortensen-smtp-resend-monitor)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[stayallive/wp-sentry

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.

387222.0k](/packages/stayallive-wp-sentry)[october/rain

October Rain Library

1601.7M87](/packages/october-rain)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[humanmade/aws-xray

HM Platform AWS X-Ray Integration

29246.8k9](/packages/humanmade-aws-xray)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
