PHPackages                             fedeisas/laravel-mail-css-inliner - 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. fedeisas/laravel-mail-css-inliner

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

fedeisas/laravel-mail-css-inliner
=================================

Inline the CSS of your HTML emails using Laravel

6.0.0(2mo ago)5974.6M—5.7%117[3 issues](https://github.com/fedeisas/laravel-mail-css-inliner/issues)[2 PRs](https://github.com/fedeisas/laravel-mail-css-inliner/pulls)3MITPHPPHP ^8.0.2CI passing

Since Feb 6Pushed 2mo ago12 watchersCompare

[ Source](https://github.com/fedeisas/laravel-mail-css-inliner)[ Packagist](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)[ RSS](/packages/fedeisas-laravel-mail-css-inliner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (25)Used By (3)

Laravel Mail CSS Inliner
========================

[](#laravel-mail-css-inliner)

[![CI status](https://github.com/fedeisas/laravel-mail-css-inliner/actions/workflows/main.yml/badge.svg)](https://github.com/fedeisas/laravel-mail-css-inliner/actions)[![Dependabot Status](https://camo.githubusercontent.com/6a51b0751549261d7bac57cd594305fc5708bf907fc01b6f34aa97e914da4f6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e6461626f742d6163746976652d627269676874677265656e3f6c6f676f3d646570656e6461626f74)](https://dependabot.com)[![Latest Stable Version](https://camo.githubusercontent.com/e7b188fcec958d16f6a9ef5b65581d8ff8933b478dce2b1e16b8778b693d3dfe/68747470733a2f2f706f7365722e707567782e6f72672f66656465697361732f6c61726176656c2d6d61696c2d6373732d696e6c696e65722f76)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)[![Latest Unstable Version](https://camo.githubusercontent.com/641b305a45a9df1c88185bde98f2778083e26416a76ed6969993ecdb5f73e588/68747470733a2f2f706f7365722e707567782e6f72672f66656465697361732f6c61726176656c2d6d61696c2d6373732d696e6c696e65722f762f756e737461626c65)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)[![Total Downloads](https://camo.githubusercontent.com/3adabe83c9264f821d6b9b83719fdc03bc704969997ad800b59f1bcb6ee3fa2e/68747470733a2f2f706f7365722e707567782e6f72672f66656465697361732f6c61726176656c2d6d61696c2d6373732d696e6c696e65722f646f776e6c6f616473)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)[![License](https://camo.githubusercontent.com/85afd46219a6865ca6c848978de1ef7f3266a37797d6c816c941744124814948/68747470733a2f2f706f7365722e707567782e6f72672f66656465697361732f6c61726176656c2d6d61696c2d6373732d696e6c696e65722f6c6963656e7365)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)

Why?
----

[](#why)

Most email clients won't render CSS (on a `` or a ``). The solution is inline your CSS directly on the HTML. Doing this by hand easily turns into unmantainable templates. The goal of this package is to automate the process of inlining that CSS before sending the emails.

Installation and compatibility
------------------------------

[](#installation-and-compatibility)

Starting with version 5 this package requires PHP 8.0 and Laravel 9.0 or higher.

Using an older version of PHP / Laravel?
----------------------------------------

[](#using-an-older-version-of-php--laravel)

If you are on a PHP version below 8.0 or a Laravel version below 9.0 just use version 4.\* of this package.

How?
----

[](#how)

Using a wonderful [CSS inliner package](https://github.com/tijsverkoyen/CssToInlineStyles) wrapped in a Symfony Mailer plugin and served as a Service Provider it just works without any configuration. Since this is a Symfony Mailer plugin, it will automatically inline your css when parsing an email template. You don't have to do anything!

Turns style tag:

```

            h1 {
                font-size: 24px;
                color: #000;
            }

        Hey you

```

Or the link tag:

```

        Hey you

```

Into this:

```

            h1 {
                font-size: 24px;
                color: #000;
            }

        Hey you

```

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

[](#installation)

This package needs Laravel 9.x.

Begin by installing this package through Composer. Require it directly from the Terminal to take the last stable version:

```
composer require fedeisas/laravel-mail-css-inliner
```

At this point the inliner should be already working with the default options. If you want to fine-tune these options, you can do so by publishing the configuration file:

```
php artisan vendor:publish --provider='Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider'
```

and changing the settings on the generated `config/css-inliner.php` file.

Contributing
------------

[](#contributing)

- Install project dependencies:

```
composer install
```

- Execute tests with the following command:

```
./vendor/bin/phpunit
```

Found a bug?
------------

[](#found-a-bug)

Please, let me know! Send a pull request or a patch. Questions? Ask! I will respond to all filed issues.

Inspiration
-----------

[](#inspiration)

This package is greatly inspired, and mostly copied, from [SwiftMailer CSS Inliner](https://github.com/OpenBuildings/swiftmailer-css-inliner). I just made an easy drop-in solution for Laravel.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance85

Actively maintained with recent releases

Popularity66

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~200 days

Recently: every ~222 days

Total

23

Last Release

84d ago

Major Versions

1.5 → 2.02016-09-20

2.3 → 3.02020-04-05

3.1 → 4.02020-12-17

4.0 → 5.02022-03-30

5.4.1 → 6.0.02026-02-24

PHP version history (5 changes)1.0PHP &gt;=5.3.2

1.5PHP &gt;=5.4.0

3.0PHP ^7.2.5

4.0PHP ^7.2|^8.0

5.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d1a4ac79561ed7edef104265d9cabcdbc936a701456d6c65d28ac29255f3bbf?d=identicon)[fedeisas](/maintainers/fedeisas)

---

Top Contributors

[![fedeisas](https://avatars.githubusercontent.com/u/251675?v=4)](https://github.com/fedeisas "fedeisas (44 commits)")[![DannyvdSluijs](https://avatars.githubusercontent.com/u/618940?v=4)](https://github.com/DannyvdSluijs "DannyvdSluijs (31 commits)")[![ceesvanegmond](https://avatars.githubusercontent.com/u/883497?v=4)](https://github.com/ceesvanegmond "ceesvanegmond (19 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (9 commits)")[![kverstae](https://avatars.githubusercontent.com/u/48050031?v=4)](https://github.com/kverstae "kverstae (7 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (7 commits)")[![kilburn](https://avatars.githubusercontent.com/u/116100?v=4)](https://github.com/kilburn "kilburn (5 commits)")[![stayallive](https://avatars.githubusercontent.com/u/1090754?v=4)](https://github.com/stayallive "stayallive (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![Belphemur](https://avatars.githubusercontent.com/u/197810?v=4)](https://github.com/Belphemur "Belphemur (2 commits)")[![Jose-dot-RS](https://avatars.githubusercontent.com/u/191534608?v=4)](https://github.com/Jose-dot-RS "Jose-dot-RS (2 commits)")[![juukie](https://avatars.githubusercontent.com/u/2678657?v=4)](https://github.com/juukie "juukie (2 commits)")[![mathieutu](https://avatars.githubusercontent.com/u/11351322?v=4)](https://github.com/mathieutu "mathieutu (2 commits)")[![rish-0593](https://avatars.githubusercontent.com/u/50861915?v=4)](https://github.com/rish-0593 "rish-0593 (2 commits)")[![underthecocotree](https://avatars.githubusercontent.com/u/18592003?v=4)](https://github.com/underthecocotree "underthecocotree (2 commits)")[![gbuckingham89](https://avatars.githubusercontent.com/u/1455253?v=4)](https://github.com/gbuckingham89 "gbuckingham89 (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![zupolgec](https://avatars.githubusercontent.com/u/161318?v=4)](https://github.com/zupolgec "zupolgec (1 commits)")[![nickbarrettjb](https://avatars.githubusercontent.com/u/16773808?v=4)](https://github.com/nickbarrettjb "nickbarrettjb (1 commits)")[![pabloroman](https://avatars.githubusercontent.com/u/450173?v=4)](https://github.com/pabloroman "pabloroman (1 commits)")

---

Tags

laravelcssmailer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fedeisas-laravel-mail-css-inliner/health.svg)

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

###  Alternatives

[s-ichikawa/laravel-sendgrid-driver

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

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

PHPackages © 2026

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