PHPackages                             motsmanish/cakephp-mailgun - 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. motsmanish/cakephp-mailgun

ActiveCakephp-plugin[Mail &amp; Notifications](/categories/mail)

motsmanish/cakephp-mailgun
==========================

Send mail via Mailgun SDK in CakePHP 3.0

v1.0.3(10y ago)321.6k2MITPHPPHP &gt;=5.4.16

Since Dec 11Pushed 10y ago2 watchersCompare

[ Source](https://github.com/motsmanish/cakephp-mailgun)[ Packagist](https://packagist.org/packages/motsmanish/cakephp-mailgun)[ Docs](https://github.com/motsmanish/cakephp-mailgun)[ RSS](/packages/motsmanish-cakephp-mailgun/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

CakePHP 3.x Mailgun Transport
=============================

[](#cakephp-3x-mailgun-transport)

Send mail via Mailgun SDK in CakePHP 3.0

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

[](#requirements)

- PHP 5.4+
- Mailgun SDK ~1.7.2
- CakePHP 3.x

Installation Steps
------------------

[](#installation-steps)

- 1. Install using composer

```
composer require motsmanish/cakephp-mailgun
```

- 2. Updated configuration in app.php

```
'EmailTransport' => [
		'default' => [
			...
		],
		'mailgun' => [
			 'className' => 'MailgunEmail\Mailer\Transport\MailgunTransport'
		],
	],
	'Email' => [
		'default' => [
			...
		],
		'mailgun' => [
			'transport' => 'mailgun',
			'mailgun_domain' => 'example.com', //required
			'mailgun_api_key' => 'key-xxxxxxxxxxxxxxxxxxxxxxxxx',  //required
			'mailgun_postbin_id' => '' //optional, provide postbin id only when you want to debug messages on http://bin.mailgun.net/ instead of actually sending
		],
	],
```

And you are good to go.

Usage
=====

[](#usage)

```
// load Email class
use Cake\Mailer\Email;

// send mail by setting all the required properties
$email = new Email('mailgun');
$result = $email->from(['me@example.com' => 'My Site'])
	->to('you@example.com')
	->subject('Hello')

	//->template('get_in_touch')
	//->viewVars(['to' => 'You', 'from' => 'Me'])
	//->emailFormat('both')

	->addHeaders(['o:tag' => 'testing'])
	->addHeaders(['o:deliverytime' => strtotime('+1 Min')])
	->addHeaders(['v:my-custom-data' => json_encode(['max' => 'testing'])])

	->readReceipt('admin@example.com')
	->returnPath('bounce@example.com')

	->attachments([
		'cake_icon1.png' => Configure::read('App.imageBaseUrl') . 'cake.icon.png',
		'cake_icon2.png' => ['file' => Configure::read('App.imageBaseUrl') . 'cake.icon.png'],
		WWW_ROOT . 'favicon.ico'
	])

	->send('How are you?');
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3842d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89372172b9961259e91d08324a374b4d13fae59a815532593bc4b9b802f3b3f4?d=identicon)[motsmanish](/maintainers/motsmanish)

---

Top Contributors

[![motsmanish](https://avatars.githubusercontent.com/u/930516?v=4)](https://github.com/motsmanish "motsmanish (31 commits)")

---

Tags

emailcakephptransportmailguncakephp3

### Embed Badge

![Health badge](/badges/motsmanish-cakephp-mailgun/health.svg)

```
[![Health](https://phpackages.com/badges/motsmanish-cakephp-mailgun/health.svg)](https://phpackages.com/packages/motsmanish-cakephp-mailgun)
```

###  Alternatives

[narendravaghela/cakephp-mailgun

Mailgun plugin for CakePHP - Send emails using Mailgun API

23364.0k](/packages/narendravaghela-cakephp-mailgun)[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57122.3k2](/packages/lorenzo-cakephp-email-queue)[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28165.8k](/packages/boundstate-yii2-mailgun)[yarcode/yii2-mailgun-mailer

Mailgun mailer implementation for Yii2

1576.5k](/packages/yarcode-yii2-mailgun-mailer)[gourmet/email

Gourmet Email Plugin for rapid CakePHP application development.

175.2k](/packages/gourmet-email)

PHPackages © 2026

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