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 3w 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 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

2488d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899175?v=4)[Anton Perevoshchikov](/maintainers/perevoshchikov)[@perevoshchikov](https://github.com/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

[symfony/form

Allows to easily create, process and reuse HTML forms

2.8k162.1M3.4k](/packages/symfony-form)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M24.5k](/packages/friendsofphp-php-cs-fixer)[symfony/mailer

Helps sending emails

1.6k409.1M1.4k](/packages/symfony-mailer)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M723](/packages/sylius-sylius)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M997](/packages/phpro-grumphp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M497](/packages/pimcore-pimcore)

PHPackages © 2026

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