PHPackages                             rnsharma93/laravel-email-sandbox - 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. rnsharma93/laravel-email-sandbox

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

rnsharma93/laravel-email-sandbox
================================

Self-hosted email testing driver &amp; dashboard for Laravel — capture and preview outgoing emails on staging without sending real mail.

v1.0.0(1mo ago)2041MITBladePHP &gt;=8.1

Since May 31Pushed 1mo agoCompare

[ Source](https://github.com/rnsharma93/laravel-email-sandbox)[ Packagist](https://packagist.org/packages/rnsharma93/laravel-email-sandbox)[ RSS](/packages/rnsharma93-laravel-email-sandbox/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Email Sandbox
=====================

[](#laravel-email-sandbox)

 A beautiful, self-hosted email testing driver &amp; dashboard for Laravel — ideal for staging environments.

 [![Latest Version on Packagist](https://camo.githubusercontent.com/11321772287b6ea7c0e197be4908991717da8f147ae8a9b350f11b1ace3809ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726e736861726d6139332f6c61726176656c2d656d61696c2d73616e64626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rnsharma93/laravel-email-sandbox) [![Total Downloads](https://camo.githubusercontent.com/7ed7620fa019af155ac24c9895cea596f5fe4ff0e229e93d172dfe779051bb9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726e736861726d6139332f6c61726176656c2d656d61696c2d73616e64626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rnsharma93/laravel-email-sandbox) [![PHP Version](https://camo.githubusercontent.com/c638d688ebd207063d2eca84e65b63b5c168871b6ca58ffb6546c65b2cd45f07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726e736861726d6139332f6c61726176656c2d656d61696c2d73616e64626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rnsharma93/laravel-email-sandbox) [![License](https://camo.githubusercontent.com/2903317596c979638a0e6417841cc3fd77d241b643a119da2becfea827773fad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726e736861726d6139332f6c61726176656c2d656d61696c2d73616e64626f782e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

---

Laravel Email Sandbox allows you to easily intercept, capture, and preview outgoing emails inside your application without sending real emails to your users. It comes with a stunning, highly responsive dashboard deeply inspired by Mailpit—built natively for Laravel with zero NPM dependencies.

Instead of paying for a hosted inbox (like Mailtrap) or installing extra software (like Mailpit) on your staging server, this package captures every outgoing email straight into your own database and renders it in a built-in dashboard.

📋 Requirements
--------------

[](#-requirements)

- PHP `8.1` or higher
- Laravel `10.x`, `11.x`, or `12.x`

📑 Table of Contents
-------------------

[](#-table-of-contents)

- [Key Features](#-key-features)
- [Screenshots](#-screenshots)
- [Installation](#-installation)
- [Usage](#-usage)
- [Access Control &amp; Security](#-access-control--security)
- [Configuration](#-configuration)
- [Developed By](#-developed-by)
- [License &amp; Open Source](#-license--open-source)

✨ Key Features
--------------

[](#-key-features)

- **Mailpit-Inspired Interface:** Beautiful, responsive UI built with Tailwind CSS &amp; Alpine.js (via CDN, no build step required).
- **Comprehensive Email Previews:** Preview emails in **HTML**, **Text**, and **HTML Source** formats.
- **Responsive Previews:** Interactive device toggles (Desktop, Tablet, Mobile) to test your email's responsiveness instantly.
- **Raw `.eml` Snapshotting:** Captures and stores the exact raw network string (Multipart MIME) for low-level debugging.
- **Advanced Filtering:** Instantly search your inbox by Subject, Body, Sender, Recipient, or Date Ranges.
- **Detailed Headers:** View completely parsed `Message-ID`, `Date`, `Mime-Version`, and all exact headers just like they were sent.
- **Attachment Support:** Safely capture, list, and download all email attachments natively.
- **Mass Deletion:** Keep your database clean with "Delete All" functionality.
- **Secure by Default:** Uses Laravel auth &amp; Gates to ensure only authorized admins can access the dashboard outside of `local`.

---

📸 Screenshots
-------------

[](#-screenshots)

 **Inbox**
 [![Email Sandbox inbox](docs/inbox.png)](docs/inbox.png)

 **Email Preview (HTML / Text / Headers / Raw)**
 [![Email preview with HTML, text, headers and raw views](docs/email-preview.png)](docs/email-preview.png)

---

🚀 Installation
--------------

[](#-installation)

Require the package via Composer:

```
composer require rnsharma93/laravel-email-sandbox
```

Publish the configuration file (optional — sensible defaults are used otherwise):

```
php artisan vendor:publish --tag="email-sandbox-config"
```

The package migrations are loaded automatically. Run them to create the `email_messages` table:

```
php artisan migrate
```

📨 Usage
-------

[](#-usage)

To start capturing outgoing emails, open your `.env` file and change your mail transport driver to `email-sandbox`:

```
MAIL_MAILER=email-sandbox
```

Now, any email sent by Laravel will be intercepted and stored in your database &amp; local storage instead of actually being delivered.

You can view all captured emails by navigating to: 👉 **`http://your-app.test/email-sandbox`**

Warning

This driver **never delivers real email**. Use it on `local` and `staging` only. If you set `MAIL_MAILER=email-sandbox` in production, your real outgoing emails will be silently captured instead of sent to your users.

### Capturing only some emails

[](#capturing-only-some-emails)

If you'd rather keep your default mailer untouched and only route specific messages to the sandbox, send them through the `email-sandbox` mailer explicitly:

```
Mail::mailer('email-sandbox')->to($user)->send(new OrderShipped($order));
```

---

🔐 Access Control &amp; Security
-------------------------------

[](#-access-control--security)

By default, the Email Sandbox UI is fully accessible in the `local` environment.

However, if you deploy this to `production`, `staging`, or `testing` environments, the route is completely locked down by default. To authorize specific users to view the dashboard in non-local environments, you must define the `accessEmailSandbox` Gate in your application's `App\Providers\AppServiceProvider`:

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

public function boot(): void
{
    Gate::define('accessEmailSandbox', function ($user) {
        // Return true if the user is an admin or authorized to view intercepted emails
        return in_array($user->email, [
            'admin@yourdomain.com',
        ]);
    });
}
```

---

🧰 Configuration
---------------

[](#-configuration)

After publishing the config file, you can adjust the following options in `config/email-sandbox.php`:

```
// config/email-sandbox.php
return [
    // The URL prefix where the dashboard is served, e.g. /email-sandbox
    'route_prefix' => 'email-sandbox',

    // Where raw .eml snapshots and attachments are stored on disk
    'storage_path' => storage_path('app/email-sandbox'),
];
```

OptionDefaultDescription`route_prefix``email-sandbox`URL prefix for the dashboard routes.`storage_path``storage/app/email-sandbox`Disk location for raw `.eml` snapshots and email attachments.👨‍💻 Developed By
----------------

[](#‍-developed-by)

**Ram Sharma**

- GitHub: [@rnsharma93](https://github.com/rnsharma93)
- Email:

If you find this package helpful in your day-to-day development and testing workflow, please consider starring the repository on GitHub!

📜 License &amp; Open Source
---------------------------

[](#-license--open-source)

The Laravel Email Sandbox package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

You are completely free to use, modify, and distribute this package in both personal and commercial projects. Contributions, issues, and feature requests are always welcome! Feel free to check the [issues page](https://github.com/rnsharma93/laravel-email-sandbox/issues) if you want to contribute.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12048984?v=4)[Ram Sharma](/maintainers/rnsharma93)[@rnsharma93](https://github.com/rnsharma93)

---

Top Contributors

[![rnsharma93](https://avatars.githubusercontent.com/u/12048984?v=4)](https://github.com/rnsharma93 "rnsharma93 (2 commits)")

### Embed Badge

![Health badge](/badges/rnsharma93-laravel-email-sandbox/health.svg)

```
[![Health](https://phpackages.com/badges/rnsharma93-laravel-email-sandbox/health.svg)](https://phpackages.com/packages/rnsharma93-laravel-email-sandbox)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.5k](/packages/laravel-framework)[illuminate/mail

The Illuminate Mail package.

5910.6M528](/packages/illuminate-mail)[illuminate/notifications

The Illuminate Notifications package.

483.1M1.2k](/packages/illuminate-notifications)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19566.0M1.8k](/packages/drupal-core)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[flarum/core

Delightfully simple forum software.

211.4M2.4k](/packages/flarum-core)

PHPackages © 2026

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