Download the PHP package ghijk/laravel-email-preview without Composer
On this page you can find all versions of the php package ghijk/laravel-email-preview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ghijk/laravel-email-preview
More information about ghijk/laravel-email-preview
Files in ghijk/laravel-email-preview
Package laravel-email-preview
Short Description A Laravel package for capturing and previewing emails in a web UI for staging/testing environments
License MIT
Informations about the package laravel-email-preview
Laravel Email Preview
A Laravel package for capturing and previewing emails in a web UI, perfect for staging and testing environments.
Features
- 📧 Capture all outgoing emails instead of sending them
- 🎨 View HTML and plain text versions of emails
- 🔍 Search and filter captured emails
- 📎 Download email attachments
- 🗄️ Store emails in database with auto-cleanup
- 🔐 Secure admin-only access
- ⚙️ Fully configurable routes and middleware
- 🎯 Zero configuration required for basic usage
Installation
1. Install via Composer
2. Publish and Run Migrations
3. Configure Mail Driver
Set your mail driver to database in .env:
That's it! You're ready to start capturing emails.
Usage
Viewing Captured Emails
Navigate to /internal/emails in your application (default route). The package provides:
- Email List: Paginated view of all captured emails with search and filters
- Email Detail: Full email preview with HTML/text toggle, headers, and attachments
- Delete Options: Delete individual emails or clear all
Cleanup Old Emails
Scheduled Cleanup
Add to app/Console/Kernel.php:
Configuration
Publish Config (Optional)
Available Options
Configure via .env:
Custom Middleware
Update config/email-preview.php:
Frontend Views
The package uses Inertia.js and expects React components at:
resources/js/Pages/Admin/CapturedEmails/Index.tsxresources/js/Pages/Admin/CapturedEmails/Show.tsx
These components should be provided by your application for full UI customization.
API
Model
Routes
All routes use the configured prefix and middleware:
GET /internal/emails- Email listGET /internal/emails/{uuid}- Email detailsDELETE /internal/emails/{uuid}- Delete emailDELETE /internal/emails- Clear all emails
How It Works
- Custom Mail Transport: Intercepts outgoing emails via custom
databasemail driver - Database Storage: Stores complete email data including HTML, text, headers, and attachments
- Web UI: Provides admin interface for viewing captured emails
- Auto-Cleanup: Optional command to remove old emails based on retention policy
Requirements
- PHP 8.1 or higher
- Laravel 10.0 or 11.0
- MySQL/PostgreSQL/SQLite (any Laravel-supported database)
Security
- Always use appropriate middleware to restrict access
- Never use in production with real customer data
- Regularly clean up captured emails
- Review captured emails before deploying to production
License
MIT License. See LICENSE for more information.
Credits
Created by Wild at Heart
Support
For issues and feature requests, please use the GitHub issue tracker.
All versions of laravel-email-preview with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/mail Version ^12.0|^13.0
symfony/mailer Version ^7.0|^8.0
symfony/mime Version ^7.0|^8.0