PHPackages                             wedevelop4you/laravel-multiple-mailers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. wedevelop4you/laravel-multiple-mailers

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

wedevelop4you/laravel-multiple-mailers
======================================

Adds multiple mailers

2.0.0(5y ago)218MITPHPPHP &gt;=7.0.0

Since Jan 21Pushed 4y agoCompare

[ Source](https://github.com/WeDevelop4You/LaravelMultipleMailers)[ Packagist](https://packagist.org/packages/wedevelop4you/laravel-multiple-mailers)[ RSS](/packages/wedevelop4you-laravel-multiple-mailers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Multiple Mailers
========================

[](#laravel-multiple-mailers)

I made this package because I wanted to use multiple mails. It is a small simple package to use multiple mails in Laravel. I'm not really going to expand it any further. Only if I want to add functions myself. You are free to use the package and here is a little explanation of how to use it.

Installation
------------

[](#installation)

PHP 7.0 or higher and Laravel 7 or higher are required.

Require this package with composer.

```
composer require wedevelop4you/laravel-multiple-mailers

```

Publish the config file by running:

```
php artisan vendor:publish --provider="WeDevelop4You\LaravelMultipleMailers\Providers\MailerServiceProvider" --tag=config

```

Config
------

[](#config)

config the mailers in: `multiple-mailer`

### Accounts config:

[](#accounts-config)

```
    /*
     *  'Choose a name for your mail config' => [
     *	    'username' => 'Your email address', (required)
     *      'password' => 'Your email password', (required)
     * 	    'name' => 'Your name send by the email' (The default name is MAIL_FROM_NAME in your .env file)
     * 	    'provider' => 'Your provider' (The default provider is default)
     *  ]
     */
    'accounts' => [
        'example' => [
            'username' => 'mailer@example.org',
            'password' => env('MAIL_PASSWORD'),
        ]
    ]
```

nametyperequireddefaultname mail configobjecttruenullusernamestringtruenullpasswordstringtruenullnamestringfalseMAIL\_FROM\_NAME in your .env fileproducesstringfalsedefault### Providers config:

[](#providers-config)

```
    /*
     *	The providers are the same as mailers in the mail config
     */
    'provider' => [
        'default' => [
            'transport' => 'smtp',
            'host' => env('MAIL_HOST'),
            'port' => env('MAIL_PORT'),
            'encryption' => env('MAIL_ENCRYPTION'),
            'timeout' => null,
            'auth_mode' => null,
        ],
    ]
```

### Queue config:

[](#queue-config)

```
     /*
     *  'worker' => The name of the queue worker. (The default name of the worker is 'default')
     *  'default' => Always use the queue worker name on mail classes with ShouldQueue.
     */
    'queue' => [
        'worker' => '',
        'default' => false,
    ]
```

If you want to queue all the mail on the same worker name but except one or more, Than you can set `onQueue` in your mail class. The code will not override the queue name.

How to use it
-------------

[](#how-to-use-it)

When sending an email you need to set the mailer. The mailer name is the name you set in the `mailer` config.

```
Mail::mailer('example');
```

Example:

```
Mail::mailer('example')->to('test@example.org')->send(new ExampleMail());
```

Now import `MultipleMailer` in your mail class.

```
use Queueable, SerializesModels, MultipleMailer;
```

Finally set the mailer name in your mail class in the `__construct` or in your own function. You need to give it the same name as above

```
$this->setMultipleMailerName('example');
```

Examples:

```
    public function __construct()
    {
        $this->setMultipleMailerName('example');
    }
```

Exceptions
----------

[](#exceptions)

### `MailerAccountNotFoundException`

[](#maileraccountnotfoundexception)

throws when the mailer name doesn't exist in the config file.

### `MailerProviderNotFoundException`

[](#mailerprovidernotfoundexception)

throws when the provider name doesn't exist in the config file.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Total

2

Last Release

1854d ago

Major Versions

1.0.0 → 2.0.02021-04-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/63a7b81d87a8e41cd4b19af912edb042007d975864a5548271e1994b806e9f67?d=identicon)[WeDevelop4You](/maintainers/WeDevelop4You)

---

Top Contributors

[![Slubby](https://avatars.githubusercontent.com/u/37977148?v=4)](https://github.com/Slubby "Slubby (28 commits)")

---

Tags

laravelmailersmtpmultiple

### Embed Badge

![Health badge](/badges/wedevelop4you-laravel-multiple-mailers/health.svg)

```
[![Health](https://phpackages.com/badges/wedevelop4you-laravel-multiple-mailers/health.svg)](https://phpackages.com/packages/wedevelop4you-laravel-multiple-mailers)
```

###  Alternatives

[aplus/email

Aplus Framework Email Library

2461.6M3](/packages/aplus-email)[hafael/azure-mailer-driver

Supercharge your Laravel or Symfony app with Microsoft Azure Communication Services (ACS)! Effortlessly add email, chat, voice, video, and telephony-over-IP for next-level communication. 🚀

14109.2k](/packages/hafael-azure-mailer-driver)[shieldon/messenger

Sending messages to the third-party services made easy for PHP.

2330.4k2](/packages/shieldon-messenger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
