PHPackages                             charcoal/email - 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. charcoal/email

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

charcoal/email
==============

Email sending and queueing for Charcoal

v5.0.0(2y ago)0111MITPHPPHP ^7.4 || ^8.0

Since May 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/charcoalphp/email)[ Packagist](https://packagist.org/packages/charcoal/email)[ Docs](https://charcoal.locomotive.ca)[ RSS](/packages/charcoal-email/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (56)Used By (1)

Charcoal Email
==============

[](#charcoal-email)

The Email package provides an integration with [PHPMailer](https://github.com/PHPMailer/PHPMailer) for sending emails.

Installation
------------

[](#installation)

```
composer require charcoal/email
```

For Charcoal projects, the service provider can be registered from your configuration file:

```
{
    "service_providers": {
        "charcoal/email/service-provider/email": {}
    }
}
```

Usage
-----

[](#usage)

```
use Charcoal\Email\ServiceProvider\EmailServiceProvider;
use Pimple\Container;

$container = new Container();
$container->register(new EmailServiceProvider());

$email = $container['email'];
$email->setData([
    'from' => '"Company inc." ',
    'bcc'  => 'shadow@example.com',
    'to'   => [
        'recipient@example.com',
        '"Some guy" ',
        [
            'name'  => 'Other guy',
            'email' => 'otherguy@example.com',
        ],
    ],
    'reply_to' => [
        'name'  => 'Jack CEO',
        'email' => 'jack@example.com'
    ],
    'subject'        => $this->translator->trans('Email subject'),
    'campaign'       => 'Campaign identifier',
    'template_ident' => 'foo/email/default-email'
    'attachments'    => [
        'foo/bar.pdf',
        'foo/baz.pdf',
    ],
]);

// Dispatch immediately:
$email->send();

// Alternately, dispatch at a later date using the queue system:
$email->queue('in 5 minutes');
```

### Email Config

[](#email-config)

The entire email system can be configured from the main app config, in the `email` config key.

```
{
    "email": {
        "smtp": true,
        "smtp_hostname": "smtp.example.com",
        "smtp_port": 25,
        "smtp_security": "tls",
        "smtp_username": "user@example.com",
        "smtp_password": "password",

        "default_from": "webproject@example.com",
        "default_reply_to": "webproject@example.com",
        "default_track": false,
        "default_log": true
    }
}
```

### Service Provider

[](#service-provider)

All email services can be quickly registered to a service container with `\Charcoal\Email\ServiceProvider\EmailServiceProvider`.

**Provided services:**

ServiceTypeDescription**email**`Email`\[1\]An email object (factory).**email/factory**`FactoryInterface`\[2\]An email factory, to create email objects.Notes:

- \[1\] `\Charcoal\Email\Email`.
- \[2\] `Charcoal\Factory\FactoryInterface`.

Also available are the following helpers:

Helper ServiceTypeDescription**email/config**`EmailConfig`\[3\]Email configuration.**email/view**`ViewInterface`\[4\]The view object to render email templates (`$container['view']`).Notes:

- \[3\] `\Charcoal\Email\EmailConfig`.
- \[4\] `\Charcoal\View\ViewInterface`.

Resources
---------

[](#resources)

- [Contributing](https://github.com/charcoalphp/.github/blob/main/CONTRIBUTING.md)
- [Report issues](https://github.com/charcoalphp/charcoal/issues) and [send pull requests](https://github.com/charcoalphp/charcoal/pulls)in the [main Charcoal repository](https://github.com/charcoalphp/charcoal)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~15 days

Total

54

Last Release

795d ago

Major Versions

0.7.2.1 → v2.1.22022-06-21

v2.2.3 → v3.1.02022-08-08

v3.1.8 → v4.0.02022-09-21

v4.1.0 → v5.0.02024-03-13

PHP version history (4 changes)0.1PHP &gt;=5.5.0

0.1.3PHP &gt;=5.6.0

0.6.0PHP &gt;=7.1

v2.1.2PHP ^7.4 || ^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/0a4f39523b4b2837562ba0848a0327b8d340118d1ba87cb0f5d59b1d5cb6beba?d=identicon)[mcaskill](/maintainers/mcaskill)

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

![](https://www.gravatar.com/avatar/4229f19eecd12c2b651b6502dcc5adfba48c5770db3d2dbea55fc92c7a246b2b?d=identicon)[BeneRoch](/maintainers/BeneRoch)

---

Top Contributors

[![mducharme](https://avatars.githubusercontent.com/u/12157?v=4)](https://github.com/mducharme "mducharme (82 commits)")[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (28 commits)")[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (27 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (18 commits)")[![BeneRoch](https://avatars.githubusercontent.com/u/3017380?v=4)](https://github.com/BeneRoch "BeneRoch (9 commits)")[![dominiclord](https://avatars.githubusercontent.com/u/1775204?v=4)](https://github.com/dominiclord "dominiclord (4 commits)")[![veve40](https://avatars.githubusercontent.com/u/7537381?v=4)](https://github.com/veve40 "veve40 (3 commits)")[![pascalrioux](https://avatars.githubusercontent.com/u/36555872?v=4)](https://github.com/pascalrioux "pascalrioux (1 commits)")[![losted](https://avatars.githubusercontent.com/u/165665?v=4)](https://github.com/losted "losted (1 commits)")

---

Tags

emailemail-senderphpphpmailerqueueread-only-repositoryemailqueuecharcoalphpmailer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/charcoal-email/health.svg)

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

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[rmrevin/yii2-postman

Mail module for Yii2.

2612.3k](/packages/rmrevin-yii2-postman)[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[itinerisltd/wp-phpmailer

WP PHPMailer provides a clean and simple way to configure WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice.

6231.6k](/packages/itinerisltd-wp-phpmailer)[tigrov/yii2-mailqueue

Yii2 mail queue component for yii2-swiftmailer.

186.1k](/packages/tigrov-yii2-mailqueue)

PHPackages © 2026

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