rulr/laravel-mailpot

A local mail inbox for Laravel

Installs: 1 315

Dependents: 0

Suggesters: 0

Security: 0

Stars: 15

Watchers: 0

Forks: 0

Open Issues: 0

Language:Blade

pkg:composer/rulr/laravel-mailpot

v1.1.0 2025-12-30 22:05 UTC

This package is auto-updated.

Last update: 2026-01-20 09:57:14 UTC


README

A local mail inbox for Laravel. No external tools or services required. Mailpot lets you intercept, store, and inspect emails sent during development.

Think of it like Mailtrap or Mailhog, but fully embedded in your Laravel app. No Docker, no SMTP config, no fuss.

Screenshot

Features

  • Stores sent mails as .json files
  • Clean inbox UI built with Tailwind and Alpine.js
  • Read/unread tracking (client-side, no database required)
  • Resizable viewport preview (mobile, tablet, desktop)
  • Stats: message count, storage size, largest/smallest message
  • Artisan commands for cleaning inbox and viewing stats
  • Configurable storage path
  • No third-party tools or services
  • Compatible with Laravel 10, 11, and 12

Installation

composer require --dev rulr/laravel-mailpot

This package is intended for local development only.

Mail Configuration

Update your config/mail.php file to add the mailpot mailer:

'mailers' => [
    'mailpot' => [
        'transport' => 'mailpot',
    ],
    // ...
],

Set the mailer in your .env file:

MAIL_MAILER=mailpot

Publishing Configuration

To customize the storage path, publish the configuration file:

php artisan vendor:publish --tag=mailpot-config

This creates config/mailpot.php with the following options:

return [
    'storage_path' => env('MAILPOT_STORAGE_PATH', storage_path('framework/mailpot')),
];

You can set a custom path in your .env file:

MAILPOT_STORAGE_PATH=/path/to/custom/mailpot

If not configured, messages are stored in storage/framework/mailpot.

Web UI

Visit the inbox in your browser:

http://localhost:8000/mailpot

The interface allows you to:

  • Browse and read emails with subject, from, to, date, and content
  • Switch between mobile, tablet, and desktop viewport sizes
  • Resize the viewport manually for custom widths
  • Track read/unread status (stored in browser localStorage)
  • View inbox statistics when no email is selected

The web UI is only available when APP_ENV=local.

Artisan Commands

Show Stats

php artisan mailpot:stats

Displays a summary of:

  • Total message count
  • Total inbox size
  • Largest and smallest message
  • Latest message details

Clean Inbox

php artisan mailpot:clean

Deletes all stored messages. You will be prompted to optionally delete the stats file as well.

Testing

This package uses Orchestra Testbench.

Run tests with:

composer test

Or directly:

./vendor/bin/phpunit

Code Quality

Run static analysis:

./vendor/bin/phpstan analyse

Run code style fixes:

./vendor/bin/pint

Files and Storage

Messages are saved to the configured storage path (default: storage/framework/mailpot).

  • Each email is stored as a .json file
  • stats.json contains cached statistics
  • .gitignore is auto-generated to exclude messages from Git

Recommended .gitignore

/vendor
/.phpunit.result.cache
/storage/framework/mailpot/*
!/storage/framework/mailpot/.gitignore

License

MIT. See LICENSE.md

Contributing

Feel free to submit PRs or open issues. Bug fixes, ideas, and improvements are welcome.

Credits

Created by Rulr for Laravel developers who want email to work locally.