PHPackages                             africoders/laravel-mailer - 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. africoders/laravel-mailer

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

africoders/laravel-mailer
=========================

Custom Laravel mailer that routes emails through an external API

00PHP

Since May 26Pushed 1y agoCompare

[ Source](https://github.com/dhtml/laravel-mailer)[ Packagist](https://packagist.org/packages/africoders/laravel-mailer)[ RSS](/packages/africoders-laravel-mailer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Africoders Laravel Mailer
=========================

[](#africoders-laravel-mailer)

A custom Laravel mail transport driver that sends emails through a centralized HTTP API instead of SMTP. Useful for routing all email traffic through services like Mailgun, Mailpit, or internal email proxy APIs.

📡 Default endpoint: `https://smtp.africoders.com/`

---

🚀 Features
----------

[](#-features)

- Custom mail transport using HTTP API
- Compatible with Laravel 8, 10, and 11
- Configurable API key and endpoint
- Fully pluggable and override-ready
- Designed for mail proxies and external SMTP wrappers

---

📦 Installation
--------------

[](#-installation)

```
composer require africoders/laravel-mailer
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### 1. Publish the package config:

[](#1-publish-the-package-config)

```
php artisan vendor:publish --tag=africoders-mailer-config
```

This publishes `config/africoders-mailer.php`:

```
return [
    'endpoint' => env('MAIL_CUSTOM_API_ENDPOINT', 'https://smtp.africoders.com/'),
    'api_key'  => env('MAIL_CUSTOM_API_KEY', 'changeme'),
];
```

### 2. Update your `.env`:

[](#2-update-your-env)

```
MAIL_MAILER=customapi
MAIL_CUSTOM_API_ENDPOINT=https://smtp.africoders.com/
MAIL_CUSTOM_API_KEY=12344343
```

---

📤 Sending Emails
----------------

[](#-sending-emails)

Once configured, all emails sent via Laravel's `Mail::to()->send()` will be routed through your custom API transport.

Example JSON payload sent to the endpoint:

```
{
  "apiKey": "12344343",
  "from_name": "Africoders",
  "to": "user@example.com",
  "subject": "Hello",
  "html": "This is a test email"
}
```

---

🛠 API Expectations
------------------

[](#-api-expectations)

Your API should accept a `POST` request with:

- `apiKey` – required, must match configured key
- `to` – recipient email
- `subject` – subject of the email
- `html` – email body (HTML)
- `from_address` – optional (defaults to config)
- `from_name` – optional (defaults to config)

---

🔐 Security
----------

[](#-security)

Make sure your API endpoint is protected using an `apiKey` or bearer token.

---

🤝 Contributing
--------------

[](#-contributing)

Pull requests welcome! For major changes, please open an issue first to discuss what you would like to change.

---

📝 License
---------

[](#-license)

MIT © Africoders

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

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/948100?v=4)[Anthony Ogundipe](/maintainers/dhtml)[@dhtml](https://github.com/dhtml)

---

Top Contributors

[![dhtml](https://avatars.githubusercontent.com/u/948100?v=4)](https://github.com/dhtml "dhtml (1 commits)")

### Embed Badge

![Health badge](/badges/africoders-laravel-mailer/health.svg)

```
[![Health](https://phpackages.com/badges/africoders-laravel-mailer/health.svg)](https://phpackages.com/packages/africoders-laravel-mailer)
```

###  Alternatives

[maize-tech/laravel-email-domain-rule

Laravel Email Domain Rule

612.0k](/packages/maize-tech-laravel-email-domain-rule)

PHPackages © 2026

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