PHPackages                             urbanindo/yii2-mail-object - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. urbanindo/yii2-mail-object

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

urbanindo/yii2-mail-object
==========================

This wraps Yii2 mailer as an object

v1.0(7y ago)012.6kMITPHPPHP &gt;=7.0

Since Jun 22Pushed 7y ago3 watchersCompare

[ Source](https://github.com/urbanindo/yii2-mail-object)[ Packagist](https://packagist.org/packages/urbanindo/yii2-mail-object)[ RSS](/packages/urbanindo-yii2-mail-object/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (5)Used By (0)

yii2-mail-object
================

[](#yii2-mail-object)

This wraps mail object that can be instantiated rather standalone.

[![Build Status](https://camo.githubusercontent.com/af032fc0693c50cc2550b2d179344af530af25ce600021b5955977c87c8e5d6a/68747470733a2f2f7472617669732d63692e6f72672f757262616e696e646f2f796969322d6d61696c2d6f626a6563742e737667)](https://travis-ci.org/urbanindo/yii2-mail-object)

Usage
-----

[](#usage)

Create new mail object class using `MailObject`.

e.g.

```
class DummyMail extends MailObject
{
    protected function getSubject(): string
    {
        return 'Hello, World!';
    }

    protected function getContentParams(): array
    {
        return [
            'recipientName' => 'Jane Doe',
        ];
    }

    protected function getRecipient(): array
    {
        return [
            'jane.doe@example.com' => 'Jane Doe',
        ];
    }

}
```

Create `html.php` and `text.php` for HTML-formatted and plain text email respectively.

To send the object, simply.

```
$mail = new DummyMail();
$mail->send();
```

Testing
-------

[](#testing)

To run testing, execute

```
./vendor/bin/phing test

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

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

Unknown

Total

1

Last Release

2881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b7f55dc6d59ee54e7f73ffc96ab51bac7e1e328894ad74998dc55df0df8433c?d=identicon)[urbanindo](/maintainers/urbanindo)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/urbanindo-yii2-mail-object/health.svg)

```
[![Health](https://phpackages.com/badges/urbanindo-yii2-mail-object/health.svg)](https://phpackages.com/packages/urbanindo-yii2-mail-object)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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