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

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

anper/mailer
============

A simple mailer, allows you to create and send emails by key.

v0.1.4(6y ago)0119MITPHPPHP ~7.1

Since Aug 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/perevoshchikov/mailer)[ Packagist](https://packagist.org/packages/anper/mailer)[ Docs](https://github.com/perevoshchikov/mailer)[ RSS](/packages/anper-mailer/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

Anper\\Mailer
=============

[](#anpermailer)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/49e69022a5bde01902cba363f79a02359090cc1157358255640ecb43d2a2ab5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e7065722f6d61696c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anper/mailer)[![Build Status](https://camo.githubusercontent.com/b05cdbace290b6b29d4c2abd114ce23575eaa04b03e0fb6ceb91638279851071/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70657265766f73686368696b6f762f6d61696c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/perevoshchikov/mailer)[![Coverage Status](https://camo.githubusercontent.com/dec85d1da62e26fdf50965efff06c16cdea53e95363c0169fb4ef4cbc1e61c05/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f70657265766f73686368696b6f762f6d61696c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/perevoshchikov/mailer?branch=master)

A simple mailer, allows you to create and send emails by key. Messages can be stored in different storages. Third-party mailers act as transport.

Install
-------

[](#install)

```
$ composer require anper/mailer
```

Usage
-----

[](#usage)

```
use Anper\Mailer\Transport\NullTransport;
use Anper\Mailer\Storage\MemoryStorage
use Anper\Mailer\Mailer;

$storage = new MemoryStorage([
    'hello' => [
        'subject' => 'Hello',
        'body'    => 'Hello World!',
        'from'    => 'from@example.com',
        'to'      => 'user@example.com',
    ],
]);

$mailer = new Mailer(new NullTransport(), $storage);

$mailer->send('hello');

// or you can modify message

$mailer->get('hello')
    ->addTo('foo@example.com')
    ->send();
```

Supports
--------

[](#supports)

- subject
- body
- from
- to
- cc
- bcc
- reply\_to
- sender
- return\_path
- attachments
- headers
- priority
- content\_type
- charset

Packages
--------

[](#packages)

- Storages
    - [anper/twig-storage](https://github.com/perevoshchikov/twig-storage)
    - [anper/php-storage](https://github.com/perevoshchikov/php-storage)
    - [anper/yaml-storage](https://github.com/perevoshchikov/yaml-storage)
- Transports
    - [anper/swiftmailer-transport](https://github.com/perevoshchikov/swiftmailer-transport)

Context
-------

[](#context)

You can pass context to the storage, for example, variables for the template in twig storage.

```
$context = [
    'foo' => 'bar'
];

$mailer->send('hello', $context);

// or

$message = $mailer->get('hello', $context);
```

Defaults
--------

[](#defaults)

```
use Anper\Mailer\Subscriber\Defaults;

$defaultMessageParameters = [
    'from' => 'admin@example.com',
    'content_type' => 'text/plain',
];

$defaultContext = [
    'teem' => 'Example Team',
];

$subscriber = new Defaults($defaultMessageParameters, $defaultContext);

$mailer->getDispatcher()
    ->addSubscriber($subscriber);
```

Test
----

[](#test)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Total

5

Last Release

2441d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce306161a01df4a895da862f7d0bd7361898e2932e62345f20ce773a84fa5a10?d=identicon)[perevoshchikov](/maintainers/perevoshchikov)

---

Top Contributors

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

---

Tags

mailer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[fedeisas/laravel-mail-css-inliner

Inline the CSS of your HTML emails using Laravel

5974.6M3](/packages/fedeisas-laravel-mail-css-inliner)[sylius/mailer-bundle

Mailers and e-mail template management for Symfony projects.

728.1M77](/packages/sylius-mailer-bundle)[voku/bounce-mail-handler

Bounce Mail Handler

49230.9k2](/packages/voku-bounce-mail-handler)[nickcv/yii2-mandrill

Mandrill Api Integration for Yii2

29554.2k2](/packages/nickcv-yii2-mandrill)[boundstate/yii2-mailgun

Mailgun integration for the Yii framework

28160.6k](/packages/boundstate-yii2-mailgun)

PHPackages © 2026

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