PHPackages                             kevinzheng/laravel-switchable-mail - 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. kevinzheng/laravel-switchable-mail

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

kevinzheng/laravel-switchable-mail
==================================

For Laravel to support multiple and switchable on runtime mail drivers.

1.3(9y ago)274.6k19[1 issues](https://github.com/kevinzheng/laravel-switchable-mail/issues)MITPHPPHP &gt;=5.6.4

Since Nov 23Pushed 9y ago2 watchersCompare

[ Source](https://github.com/kevinzheng/laravel-switchable-mail)[ Packagist](https://packagist.org/packages/kevinzheng/laravel-switchable-mail)[ Docs](https://github.com/kevinzheng/laravel-switchable-mail)[ RSS](/packages/kevinzheng-laravel-switchable-mail/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

laravel-switchable-mail
=======================

[](#laravel-switchable-mail)

It makes `Laravel` be able to maintain multiple mail drivers at the same time, and be able to send to different mail addresses with specified mail drivers as configured at runtime automatically.

Instructions
------------

[](#instructions)

[English](README.md)

[中文简体](README.zh_CN.md)

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

[](#installation)

1. Install this package using the Composer manager:

    ```
    composer require kevinzheng/laravel-switchable-mail
    ```
2. **Replace** `Illuminate\Mail\MailServiceProvider::class` with `KVZ\Laravel\SwitchableMail\MailServiceProvider::class` in the `config/app.php` file.
3. Publish configuration file:

    ```
    php artisan vendor:publish --tag=switchable-mail
    ```

Configuration
-------------

[](#configuration)

It uses the `MAIL_DRIVER` configured in `.env` as the default mail driver, for those addresses you want to send to with specified mail drivers, configure it at `switchable-mail.php`. You should install the mail drivers not provided by `Laravel` at the meantime, such as Aliyun `Direct Mail` and `SendCloud`:

```
```php
// 'directmail' => [
//     'qq.com', '163.com', '126.com', 'sina.com', 'sina.com.cn', 'sohu.com',
// ],

// 'mailgun' => [
//     'example.com',
// ],
```

```

Two mail drivers are available:

[laravel-directmail](https://github.com/kevinzheng/laravel-directmail)

[laravel-sendcloud](https://github.com/kevinzheng/laravel-sendcloud)

Usage
-----

[](#usage)

Nothing needs to be done, just use `Laravel Mail` as usual.

Thanks to
---------

[](#thanks-to)

[ElfSundae](https://github.com/ElfSundae)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 81.6% 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 ~0 days

Total

4

Last Release

3455d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e36119970a756f89cf6791d75b3a8c78393b8aaa55b443c1a54bc6b64b2fc3a7?d=identicon)[kevinzheng](/maintainers/kevinzheng)

---

Top Contributors

[![ElfSundae](https://avatars.githubusercontent.com/u/526008?v=4)](https://github.com/ElfSundae "ElfSundae (31 commits)")[![kvzn](https://avatars.githubusercontent.com/u/313271?v=4)](https://github.com/kvzn "kvzn (7 commits)")

### Embed Badge

![Health badge](/badges/kevinzheng-laravel-switchable-mail/health.svg)

```
[![Health](https://phpackages.com/badges/kevinzheng-laravel-switchable-mail/health.svg)](https://phpackages.com/packages/kevinzheng-laravel-switchable-mail)
```

###  Alternatives

[fedeisas/laravel-mail-css-inliner

Inline the CSS of your HTML emails using Laravel

5974.6M3](/packages/fedeisas-laravel-mail-css-inliner)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[coconutcraig/laravel-postmark

Laravel package for sending mail via the Postmark API

2152.9M1](/packages/coconutcraig-laravel-postmark)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)[illuminate/notifications

The Illuminate Notifications package.

483.0M967](/packages/illuminate-notifications)[squareboat/sneaker

An easy way to send emails with stack trace whenever an exception occurs on the server for Laravel Applications.

220191.2k](/packages/squareboat-sneaker)

PHPackages © 2026

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