PHPackages                             appoly/mail-web - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. appoly/mail-web

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

appoly/mail-web
===============

Catch your outgoing emails within your project making it easier to test and share

v7.0.0(1mo ago)08.3k↑23.3%1MITVuePHP ^8.1CI passing

Since Mar 6Pushed 1mo agoCompare

[ Source](https://github.com/appoly/mail-web)[ Packagist](https://packagist.org/packages/appoly/mail-web)[ GitHub Sponsors](https://github.com/appoly)[ Patreon](https://www.patreon.com/appoly)[ RSS](/packages/appoly-mail-web/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (55)Used By (0)

MailWeb
=======

[](#mailweb)

Catch and inspect outgoing emails from your Laravel application in a web dashboard.

[![Total Downloads](https://camo.githubusercontent.com/d229008d83f95721228f2743ddcff1aa8246a0d2176360c36b93299788ba7504/68747470733a2f2f706f7365722e707567782e6f72672f6170706f6c792f6d61696c2d7765622f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/appoly/mail-web)[![Latest Stable Version](https://camo.githubusercontent.com/506b6c830e50df4511c8733b59e9ac9818701ba8fd47c9d45da231a2aef03788/68747470733a2f2f706f7365722e707567782e6f72672f6170706f6c792f6d61696c2d7765622f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/appoly/mail-web)[![License](https://camo.githubusercontent.com/40118cd404b98640348f5d9c2f0c774f08c2b85ee818410696b534b4d542d95b/68747470733a2f2f706f7365722e707567782e6f72672f6170706f6c792f6d61696c2d7765622f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/appoly/mail-web)

MailWeb intercepts emails as they're sent and stores them in your database. You get a dashboard at `/mailweb` where you can search, filter, preview, and share captured emails, including any attachments.

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

[](#requirements)

- PHP 8.1+
- Laravel 9.21, 10, 11, 12, or 13

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

[](#installation)

Install the package:

```
composer require appoly/mail-web
```

Run the migrations:

```
php artisan migrate
```

Register the routes in your `routes/web.php`:

```
Route::mailweb();
```

That's it. Emails sent by your application will now be captured and available at `/mailweb`.

Access Control
--------------

[](#access-control)

MailWeb uses a Laravel Gate to control who can access the dashboard. Define the `view-mailweb` gate in your `AppServiceProvider`:

```
use Illuminate\Support\Facades\Gate;

public function boot()
{
    Gate::define('view-mailweb', function ($user) {
        return in_array($user->email, [
            'you@example.com',
        ]);
    });
}
```

All dashboard routes require authentication and this gate check. The only exception is the public share link (`/mailweb/share/{id}`), which is accessible to anyone if sharing is enabled on that email.

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

[](#configuration)

Publish the config file if you need to change anything:

```
php artisan vendor:publish --tag=mailweb-config --force
```

This creates `config/MailWeb.php`. Everything can also be set via environment variables:

Environment VariableDefaultDescription`MAILWEB_ENABLED``true`Enable or disable email capturing entirely`MAILWEB_SINGLESTORE``false`Enable or disable SingleStore support`MAILWEB_LIMIT``30`Maximum number of emails kept in the database`MAILWEB_SEND_SAMPLE_BUTTON``true`Show the "Send Test Email" button in the dashboard`MAILWEB_DELETE_ALL_ENABLED``false`Allow bulk deletion of all emails from the dashboard`MAILWEB_RETURN_APP_NAME`Your `app.name`App name shown in the dashboard's return link`MAILWEB_RETURN_APP_URL``/`URL the return link points to`MAILWEB_ATTACHMENTS_DISK``null`Storage disk for attachments (e.g. `s3`, `local`)`MAILWEB_ATTACHMENTS_PATH``mailweb/attachments`Path within the disk where attachments are storedAttachments
-----------

[](#attachments)

By default, attachment metadata is stored in the database but the files themselves aren't persisted to disk. To keep the actual files, configure a storage disk:

```
MAILWEB_ATTACHMENTS_DISK=s3
MAILWEB_ATTACHMENTS_PATH=mailweb/attachments
```

This works with any Laravel filesystem disk. Attachments are stored at `{path}/{email_id}/{attachment_id}.{extension}`. If the disk supports temporary URLs (like S3), download links will be signed and expire after 30 minutes.

Pruning Old Emails
------------------

[](#pruning-old-emails)

MailWeb stores up to `MAILWEB_LIMIT` emails. To clean up older ones automatically, schedule the prune command in `routes/console.php`:

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('mailweb:prune')->daily();
```

You can also run it manually with an optional count of how many emails to keep:

```
php artisan mailweb:prune 50
```

If no count is provided, it uses the `MAILWEB_LIMIT` config value.

Dashboard Features
------------------

[](#dashboard-features)

- **Search** across subject and body content
- **Filter** by unread status or whether emails have attachments
- **Preview** HTML, plain text, and raw source for each email
- **Share** individual emails via a public link with QR code
- **Attachments** can be previewed (images) or downloaded
- **Send test emails** using one of five built-in templates to check your setup
- **Delete** individual emails or all at once (if enabled)
- **Polling** for new emails in real time
- **Settings** for date format and pagination preferences (stored in your browser)

Local Development
-----------------

[](#local-development)

For local development, you probably want to set your mail driver to `log` so emails aren't actually sent anywhere:

```
MAIL_MAILER=log
```

Emails will still be captured and shown in MailWeb regardless of which mail driver you use.

### Working on the Package

[](#working-on-the-package)

If you're contributing to MailWeb itself, symlink it into a test Laravel project:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "../path/to/mail-web",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
        "appoly/mail-web": "@dev"
    }
}
```

Frontend assets are built with Vite:

```
npm install
npm run build
```

Built assets are committed to `public/vendor/mailweb/` so end users don't need Node.

Licence
-------

[](#licence)

MIT. See [LICENSE](https://choosealicense.com/licenses/mit/) for details.

---

Made by [Appoly](https://appoly.co.uk)

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 68.9% 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 ~47 days

Recently: every ~77 days

Total

48

Last Release

54d ago

Major Versions

2.0.8 → 4.0.02022-08-24

2.1.0 → 4.0.22022-10-21

4.0.9 → 5.0.02024-03-01

5.1.0 → 6.0.02025-03-14

6.1.4 → v7.0.02026-03-26

PHP version history (5 changes)0.0.1PHP ^7.1

2.0.0PHP ^7.4|^8.0

4.0.8PHP ^8.1|^8.2

4.0.9PHP ^7.4|^8.0|^8.1|^8.2

5.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/69684a203a56f31f41383ce7bc7be23cdf2140a36eac7a6558bda31c1b53924b?d=identicon)[Mezzair](/maintainers/Mezzair)

---

Top Contributors

[![CalumChamberlain](https://avatars.githubusercontent.com/u/34173688?v=4)](https://github.com/CalumChamberlain "CalumChamberlain (199 commits)")[![Nathanjms](https://avatars.githubusercontent.com/u/64075030?v=4)](https://github.com/Nathanjms "Nathanjms (37 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (31 commits)")[![ryanhughes00](https://avatars.githubusercontent.com/u/145984583?v=4)](https://github.com/ryanhughes00 "ryanhughes00 (6 commits)")[![johnwedgbury](https://avatars.githubusercontent.com/u/7074044?v=4)](https://github.com/johnwedgbury "johnwedgbury (5 commits)")[![Mezzair](https://avatars.githubusercontent.com/u/771973?v=4)](https://github.com/Mezzair "Mezzair (5 commits)")[![NickC404](https://avatars.githubusercontent.com/u/18194821?v=4)](https://github.com/NickC404 "NickC404 (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![jimAppoly](https://avatars.githubusercontent.com/u/70890565?v=4)](https://github.com/jimAppoly "jimAppoly (1 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/appoly-mail-web/health.svg)

```
[![Health](https://phpackages.com/badges/appoly-mail-web/health.svg)](https://phpackages.com/packages/appoly-mail-web)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[illuminate/mail

The Illuminate Mail package.

5910.1M391](/packages/illuminate-mail)

PHPackages © 2026

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