Download the PHP package resohead/laravel-test-mail without Composer
On this page you can find all versions of the php package resohead/laravel-test-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download resohead/laravel-test-mail
More information about resohead/laravel-test-mail
Files in resohead/laravel-test-mail
Package laravel-test-mail
Short Description Quickly send test emails using commands in Laravel applications
License MIT
Homepage https://github.com/resohead/laravel-test-mail
Informations about the package laravel-test-mail
Laravel Test Mail
A simple package to send test emails from artisan commands in Laravel applications. Ideal for checking mail and queue configurations without any setup.
Installation
You can install the package via composer:
The package will automatically register itself.
Optionally publish the config file to enable presets:
Basic Usage
To send a test email run the following artisan command:
By default this will:
- send to the 'from' address defined in your mail config,
- use your default mail driver,
- synchronous processing
Alternatively you have four other options in the command signature:
- set the email address,
- change the mail driver,
- enable for queuing (and set the queue name)
- change the queue connection
- select a preset
Changing the mail driver and running through a queue might require the queue worker to be started/reset.
Command Line Options
Send to specified email
Send to specified email on default queue
Send via log driver
Send to the 'emails' queue on default connection
There is no need to set the --queue flag when using the stack argument
Send using 'sqs' queue connection
There is no need to set the --queue flag when using the connection argument
Send using the SMTP driver via the 'emails' queue on the 'redis' connection
Queues
You might need to start the your queue if using the connection option, for example
Presets
You can also configure presets to group command line options. The values defined in each preset will be merged with the command line values and your default mail and queue configuration.
Example config\mail-test.php
Preset: Example 1
Set a specific email address and use default queue:
Preset: Example 2
Use the log mail driver and emails queue
Preset: Example 3
Use the log mail driver and emails queue
Alternatives
This is a simple package designed to quickly trigger an email to check your configuration.
If you want to check what an email looks like in the browser use the Laravel documentation to render mailables (available since Laravel 5.5).
If you need a package to send a mailable using fake data try using Spatie's laravel-mailable-test package.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Sean White
- All Contributors
License
The MIT License (MIT). Please see License File for more information.