PHPackages                             smajohusic/laravel-mail-logger - 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. smajohusic/laravel-mail-logger

ActivePackage[Logging &amp; Monitoring](/categories/logging)

smajohusic/laravel-mail-logger
==============================

Listens to Mail send event, and saves the information to database as backup/log

1.0.1(8y ago)52.0k↓11.8%1MITPHPPHP &gt;=7.0.0

Since Oct 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/smajohusic/laravel-mail-logger)[ Packagist](https://packagist.org/packages/smajohusic/laravel-mail-logger)[ RSS](/packages/smajohusic-laravel-mail-logger/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (10)Used By (0)

Laravel Mail Logger
===================

[](#laravel-mail-logger)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c456ec583ad3c29340a39163a5557493014cbb4c3ae59d553330e9bb16ba886/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d616a6f68757369632f6c61726176656c2d6d61696c2d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smajohusic/laravel-mail-logger)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a0c9fdc576ad01375c75ccd82aa937ba81d0771db02c6b7a494e15513a4288be/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736d616a6f68757369632f6c61726176656c2d6d61696c2d6c6f676765722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/smajohusic/laravel-mail-logger)[![Total Downloads](https://camo.githubusercontent.com/248c445c901eca6b95bb3497d0e3b92a554e562404a4fecee2a91b924318fc99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d616a6f68757369632f6c61726176656c2d6d61696c2d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smajohusic/laravel-mail-logger)

### Introduction

[](#introduction)

Mail logger has one purpose, save mail before they are sent from your app. This enables you to have backup of mail and a overview if something goes wrong.

This package listens to the MessageSending event fired from Mailer. The listener will dispatch a job, then save the needed form information, event, route and recipient to the database.

This package also supports auto deleting. You can define how long the the app should keep the logs by defining days in the config file.

### Installation

[](#installation)

#### Laravel 5.5 +

[](#laravel-55-)

1. `composer require smajohusic/laravel-mail-logger`
2. Package is automatically discovered and registered via Laravel's automatic service provider registration.

#### Laravel 5.4 or earlier

[](#laravel-54-or-earlier)

1. `composer require smajohusic/laravel-mail-logger`
2. Add `Smajo\MailLogger\MailLogServiceProvider::class` to providers in app.php
3. Execute command: `php artisan vendor:publish --provider="Smajo\MailLogger\MailLogServiceProvider"`
4. Run: `php artisan migrate` to generate the mail-logger table

### Requirements

[](#requirements)

***Cron job***

To enable auto-deleting you will need to set up a cron job that runs

`php artisan schedule:run`

### Usage

[](#usage)

##### mailLogger.php config

[](#mailloggerphp-config)

By default the auto-deleting is disabled. To enable it set

`'enableAutoDeletion' => true,`

You can set how long the logs should be stored in the database by giving amount in days.

`'keepLogsForDays' => 30,`

To make it easier to find mails, you can define all "to" fields your app uses in forms. This will then find the user e-mail in the request, and save it as the "sender" field.

```
'toEmailAddresses' => [
    'email',
    'e-mail',
    'to',
]
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~4 days

Total

7

Last Release

3158d ago

Major Versions

0.1.4 → 1.0.02017-11-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13624422?v=4)[Smajo Husic](/maintainers/smajohusic)[@smajohusic](https://github.com/smajohusic)

---

Top Contributors

[![smajohusic](https://avatars.githubusercontent.com/u/13624422?v=4)](https://github.com/smajohusic "smajohusic (24 commits)")[![ecrmnn](https://avatars.githubusercontent.com/u/1481696?v=4)](https://github.com/ecrmnn "ecrmnn (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/smajohusic-laravel-mail-logger/health.svg)

```
[![Health](https://phpackages.com/badges/smajohusic-laravel-mail-logger/health.svg)](https://phpackages.com/packages/smajohusic-laravel-mail-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M275](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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