PHPackages                             elitetools/laravel-email-relay - 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. elitetools/laravel-email-relay

ActiveLibrary

elitetools/laravel-email-relay
==============================

Custom Laravel email transport that forwards mail via an HTTP relay API.

00PHP

Since Aug 8Pushed todayCompare

[ Source](https://github.com/for4izen/laravel-email-relay)[ Packagist](https://packagist.org/packages/elitetools/laravel-email-relay)[ RSS](/packages/elitetools-laravel-email-relay/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (1)Used By (0)

laravel-email-relay
===================

[](#laravel-email-relay)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4c26439669b599dcf72997c631826ebe3d45ba1a776c7d70fe7f33df9ab53c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c697465746f6f6c732f6c61726176656c2d656d61696c2d72656c61792e737667)](https://packagist.org/packages/elitetools/laravel-email-relay)[![License](https://camo.githubusercontent.com/74e9326d340da468a28dc813f53bb4879f2328ead4e1edd67a50c2b30c322f0c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f656c697465746f6f6c732f6c61726176656c2d656d61696c2d72656c61792e737667)](LICENSE)

Custom Laravel email transport that forwards mail via an HTTP relay API.

---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

---

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

[](#installation)

**1. Install the package:**

```
composer require elitetools/laravel-email-relay
```

That's it! The package automatically registers the `emailrelay` mailer and its service configuration via Laravel's package discovery.

---

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

[](#configuration)

Just set these variables in your `.env` file:

```
MAIL_MAILER=emailrelay
EMAIL_RELAY_URL=https://your-relay-api.example.com
EMAIL_RELAY_TOKEN=your-secret-token
```

---

Usage
-----

[](#usage)

Use it like any standard Laravel Mailable. Optionally set the `X-Email-Type` header to categorize the email on the relay side:

```
Mail::to($user)->send(
    (new WelcomeMail($user))->withSymfonyMessage(function ($message) {
        $message->getHeaders()->addTextHeader('X-Email-Type', 'Welcome');
    })
);
```

---

How it works
------------

[](#how-it-works)

1. Intercepts outgoing mail via a custom Symfony `AbstractTransport`
2. Builds a JSON payload with `type`, `sendToAddress`, `senderName`, `senderAddress`, `subject`, and `body`
3. POSTs to `{EMAIL_RELAY_URL}/send` with a Bearer token
4. Throws an exception if the relay returns a non-2xx response

---

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/91918972?v=4)[For4izen](/maintainers/For4izen)[@for4izen](https://github.com/for4izen)

---

Top Contributors

[![for4izen](https://avatars.githubusercontent.com/u/91918972?v=4)](https://github.com/for4izen "for4izen (5 commits)")

### Embed Badge

![Health badge](/badges/elitetools-laravel-email-relay/health.svg)

```
[![Health](https://phpackages.com/badges/elitetools-laravel-email-relay/health.svg)](https://phpackages.com/packages/elitetools-laravel-email-relay)
```

PHPackages © 2026

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