Looking to hire Laravel developers? Try LaraJobs

laravel-alternative-mailer maintained by cyber-duck

Description
Allow Laravel to send emails through two different mail configurations.
Author
Last update
2021/10/26 11:59 (dev-master)
License
Downloads
2 327

Comments
comments powered by Disqus

🚨 Discontinued 🚨

This package is available in Laravel be default in later releases.

Laravel Alternative Mailer

Build Status Latest Stable Version Total Downloads License

This package allows a Laravel 5 application to send emails through two different mail configurations. This package has been adapted from illuminate/mail by Taylor Otwell.

Author: Simone Todaro

Install

Require this package with composer:

composer require cyber-duck/laravel-alternative-mailer:~1.0.2

After updating composer, add the ServiceProvider to the providers array in config/app.php

'providers' => array(
    ...
    'Cyberduck\Mail\MailServiceProvider'
)

And add an alias in config/app.php:

'aliases' => array(
    'Mail2' => 'Cyberduck\Mail\Facades\Mail',
)

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="Cyberduck\Mail\MailServiceProvider"

Finally, set up your configuration in config/mail2.php

Usage

To send an email with the alternative configuration, use the Mail2 facade with the same syntax of the Mail facade.

\Mail2::send('emails.reminder', ['user' => $user], function ($m) use ($user) {
    $m->from('hello@app.com', 'Your Application');
    $m->to($user->email, $user->name);
    $m->subject('Your Reminder!');
});