PHP Classes

Laravel Local Email Sender: Send email messages to logs that can be viewed

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 33 All time: 11,097 This week: 40Up
Version License PHP version Categories
laravel-local-mailer 1.0MIT/X Consortium ...8Email, Debug, Logging, Testing, PHP 8
Description 

Author

This package can send email messages to logs that can be viewed.

It provides a local mailer transport class compatible with actual mailer transport classes that can send messages to real mail addresses, except that messages are sent to local log files.

The package also provides a Web-based user interface that lets developers view the messages sent to local mailer logs.

Innovation Award
PHP Programming Innovation award nominee
September 2023
Number 6
When a developer is working on a version of an application on his development computer, he may need to send email messages as part of the functionality of the applications.

Usually, development computers are inside a restricted network like a company office or a home office network.

Therefore, email messages cannot be delivered to remote addresses due to the restrictions of those networks.

Still, when the developer needs to test the email messages the application sends, he needs at least to view the messages sent by the application he is developing.

This package provides an alternative solution. It provides a local mailer service that developers can use in Laravel applications.

Instead of sending messages to a remote mail server, it sends messages to local log files. This way, developers can see the messages sent to the log files using a Web user interface also provided by this package.

Manuel Lemos
Picture of Andrey Iatsenko
  Performance   Level  
Innovation award
Innovation award
Nominee: 7x

 

Documentation

Local mailer for laravel

Packagist Version GitHub Workflow Status Coverage License Packagist Downloads Packagist Downloads

Each developer needs to check the sending of email messages during development. Most of them have their own ways - usage gmail, Mailtrap, laravel logs, etc.

This solution will create its own mail transport, saving emails as daily logs, with the ability to view!

image

:scroll: Installation

The package can be installed via composer:

composer require yzen.dev/laravel-local-mailer

In the config config/mail.php add a new transport:

return [
    //...
    'mailers' => [
        //...
        'local-mailer' => [
            'transport' => 'local-mailer'
        ],
    ]
]

Now you can include this transport in the env:

MAIL_MAILER=local-mailer

The page for viewing is available at `{HOST}/local-mailer`. Here you can view the log for any date. For each log, the full email will be displayed - the title, to, contents of the letter (html page), attached files, etc.

image


  Files folder image Files (39)  
File Role Description
Files folder image.github (1 directory)
Files folder imagesrc (6 files, 5 directories)
Files folder imagetests (1 file, 3 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:33
This week:0
All time:11,097
This week:40Up