PHPackages                             phalcon/incubator-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. [Framework](/categories/framework)
4. /
5. phalcon/incubator-mailer

ActiveLibrary[Framework](/categories/framework)

phalcon/incubator-mailer
========================

Phalcon Incubator Mailer Adapters

v3.0.0(10mo ago)1318.1k—9.5%8[1 PRs](https://github.com/phalcon/incubator-mailer/pulls)2BSD-3-ClausePHPPHP &gt;=8.1CI passing

Since Oct 10Pushed 3mo ago6 watchersCompare

[ Source](https://github.com/phalcon/incubator-mailer)[ Packagist](https://packagist.org/packages/phalcon/incubator-mailer)[ Docs](https://phalcon.io)[ GitHub Sponsors](https://github.com/phalcon)[ Fund](https://opencollective.com/phalcon)[ RSS](/packages/phalcon-incubator-mailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (6)Used By (2)

Phalcon\\Incubator\\Mailer
==========================

[](#phalconincubatormailer)

[![Discord](https://camo.githubusercontent.com/28c6fc95b5decf0e67719a5438501589c00b2db2b15228e67479d6548bbc9f6b/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3331303931303438383135323337353239373f6c6162656c3d446973636f7264)](http://phalcon.io/discord)[![Packagist Version](https://camo.githubusercontent.com/5a46d528ccd039e64895e32cf06f2b13318b44854b85cc782993b04d6884992c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068616c636f6e2f696e63756261746f722d6d61696c6572)](https://packagist.org/packages/phalcon/incubator-mailer)[![PHP from Packagist](https://camo.githubusercontent.com/1c3958756d37ff911e12d96caf59af1e27d9708fda19d17140edfdeda782bdcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068616c636f6e2f696e63756261746f722d6d61696c6572)](https://packagist.org/packages/phalcon/incubator-mailer)[![codecov](https://camo.githubusercontent.com/2b3a334a0173e60e09b39d83c8c902eccd539eb0f7a76f03904bd868b2525c51/68747470733a2f2f636f6465636f762e696f2f67682f7068616c636f6e2f696e63756261746f722d6d61696c65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/phalcon/incubator-mailer)[![Packagist](https://camo.githubusercontent.com/d0eb5fb5b9c4c859aaca11cb5ce2993053d655eeac54a48f8cd2218d9bf0b97d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f7068616c636f6e2f696e63756261746f722d6d61696c6572)](https://packagist.org/packages/phalcon/incubator-mailer/stats)

Usage examples of the mailer wrapper over [PHPMailer](https://github.com/PHPMailer/PHPMailer) for Phalcon:

Configure
---------

[](#configure)

### SMTP

[](#smtp)

```
$config = [
    'driver'     => 'smtp',
    'host'       => 'smtp.gmail.com',
    'port'       => 465,
    'encryption' => 'ssl',
    'username'   => 'example@gmail.com',
    'password'   => 'your_password',
    'from'       => [
        'email' => 'example@gmail.com',
        'name'  => 'YOUR FROM NAME'
    ]
];
```

### Sendmail

[](#sendmail)

```
$config = [
    'driver'   => 'sendmail',
    'sendmail' => '/usr/sbin/sendmail -bs',
    'from'     => [
        'email' => 'example@gmail.com',
        'name'  => 'YOUR FROM NAME'
    ]
];
```

Send message
------------

[](#send-message)

### createMessage()

[](#createmessage)

```
$mailer = new \Phalcon\Incubator\Mailer\Manager($config);

$message = $mailer->createMessage()
        ->to('example_to@gmail.com', 'OPTIONAL NAME')
        ->subject('Hello world!')
        ->content('Hello world!');

// Set the Cc addresses of this message.
$message->cc('example_cc@gmail.com');

// Set the Bcc addresses of this message.
$message->bcc('example_bcc@gmail.com');

// Send message
$message->send();
```

### createMessageFromView()

[](#createmessagefromview)

```
// To create message with View, you need to define in the DI the component simple View.
$this->di->set(
    'simple',
    function () use ($config) {
        $view = new Phalcon\Mvc\View\Simple();
        $view->setViewsDir($config->application->viewsDir);

        return $view;
    },
    true
);

$this->di->setShared('view', function () use ($config) {
    $view = new Phalcon\Mvc\View($this->di);
    $view->setViewsDir($config->application->viewsDir);

    $view->registerEngines([
        '.volt'  => function ($view) {
            $volt = new Phalcon\Mvc\View\Engine\Volt($view, $this->di);
            $volt->setOptions([
                'path'      => $config->application->cacheDir,
                'separator' => '_'
            ]);

            return $volt;
        },
        '.phtml' => Phalcon\Mvc\View\Engine\Php::class
    ]);

    return $view;
});

$mailer = new \Phalcon\Incubator\Mailer\Manager($config);

// view relative to the folder viewsDir (REQUIRED)
$viewPath = 'email/example_message';

// Set variables to views (OPTIONAL)
$params = [
    'var1' => 'VAR VALUE 1',
    'var2' => 'VAR VALUE 2',
    // ...
    'varN' => 'VAR VALUE N'
];

$message = $mailer->createMessageFromView($viewPath, $params)
        ->to('example_to@gmail.com', 'OPTIONAL NAME')
        ->subject('Hello world!');

// Set the Cc addresses of this message.
$message->cc('example_cc@gmail.com');

// Set the Bcc addresses of this message.
$message->bcc('example_bcc@gmail.com');

// Send message
$message->send();
```

Events
------

[](#events)

All events are callables with at least 2 arguments

Look for each event down below for more informations of the third argument

```
- mailer:beforeCreateMessage
    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Manager $manager, null) {};

- mailer:afterCreateMessage
    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Manager $manager, Phalcon\Incubator\Mailer\Message $message) {};

- mailer:beforeSend
    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Message $message, null) {};

- mailer:afterSend
    2 arguments, the number of sent mails and an array of emails representing the failed recipients

    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Message $message, [int $count, array $failedRecipients]) {};

- mailer:beforeAttachFile
    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Message $message, null) {};

- mailer:afterAttachFile
    1 argument, an array with the attachment informations

    function (Phalcon\Events\Event $event, Phalcon\Incubator\Mailer\Message $message, array $attachment) {};

    0: string (path of the file or encoded data)
    1: string (name of the attachment)
    2: string (basename of the attachment)
    3: string (encoding)
    4: string (MIME type)
    5: bool (false -> encoded data, true -> from a file)
    6: string (disposition of the mail)
    7: string|0 (if from a file, name of the file)
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance68

Regular maintenance activity

Popularity36

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 56.3% 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 ~576 days

Total

4

Last Release

316d ago

Major Versions

v1.0.0 → v2.x-dev2021-10-08

v2.0.0 → v3.0.02025-07-06

PHP version history (3 changes)v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=7.4

v3.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![jenovateurs](https://avatars.githubusercontent.com/u/3491729?v=4)](https://github.com/jenovateurs "jenovateurs (116 commits)")[![rayanlevert](https://avatars.githubusercontent.com/u/78140431?v=4)](https://github.com/rayanlevert "rayanlevert (64 commits)")[![Jeckerson](https://avatars.githubusercontent.com/u/3289702?v=4)](https://github.com/Jeckerson "Jeckerson (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![niden](https://avatars.githubusercontent.com/u/1073784?v=4)](https://github.com/niden "niden (3 commits)")[![yannux](https://avatars.githubusercontent.com/u/533125?v=4)](https://github.com/yannux "yannux (3 commits)")[![xiaochong0302](https://avatars.githubusercontent.com/u/1624955?v=4)](https://github.com/xiaochong0302 "xiaochong0302 (1 commits)")

---

Tags

mailphalconswiftmailerframeworkmailerphalconsmtpsendmailincubatorphpmail

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phalcon/incubator

Adapters, prototypes or functionality that can be potentially incorporated to the C-framework.

7222.9M81](/packages/phalcon-incubator)[phalcon/devtools

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phalcon framework.

1.3k2.0M54](/packages/phalcon-devtools)[phalcon/migrations

Run and Generate DB Migrations with Phalcon Framework

29977.8k6](/packages/phalcon-migrations)

PHPackages © 2026

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