PHPackages                             hete/mail - 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. hete/mail

ActiveKohana-module[Mail &amp; Notifications](/categories/mail)

hete/mail
=========

Mailer with multiple backend for the Kohana framework

5202[3 issues](https://github.com/Hete/kohana-mail/issues)[1 PRs](https://github.com/Hete/kohana-mail/pulls)PHPCI failing

Since Aug 14Pushed 10y ago8 watchersCompare

[ Source](https://github.com/Hete/kohana-mail)[ Packagist](https://packagist.org/packages/hete/mail)[ RSS](/packages/hete-mail/feed)WikiDiscussions 3.3/master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

kohana-mail
===========

[](#kohana-mail)

Simple mailer for the Kohana framework.

Supports the following senders

- `mail` built-in function
- [PEAR Mail](http://pear.php.net/package/Mail/)
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
- mock sender for testing

It aims to unify mailing system under a single interface so that you can deploy your app independently of available libraries on the server or in your organization.

The SMTP sender for PEAR Mail module uses old PHP4 code that throws strict warnings. If imported, it will automatically disable `E_STRICT`. It is recommended to use it in `PRODUCTION` environment and test with an alternate sender.

Basic usage
-----------

[](#basic-usage)

```
Mailer::factory()
    ->headers('Content-Type', 'text/html')
    // ->headers('Content-Type', 'text/html; charset=utf-8') to specify UTF-8 character encoding
    ->subject('Hey :username!')
    ->body(View::factory('some_template'))
    ->param(':username', 'John McGuire')
    ->send(array('John McGuire' => 'foo@example.com' ));
```

The `Mail_Sender::param` function is used to substitute the body and subject. If you use a `View` for your body, it is more convenient to pass variables using `View::factory`.

Headers are set through the `headers` function. If the value is an `array`, the header will be parsed as a RFC recipient list.

```
$mailer->headers('Bcc', array('johndoe@example.com' => 'John Doe'));
```

Alias are defined for `Cc`, `Bcc`, `Reply-To` and more for convenience.

```
$mailer->bcc('johndoe@example.com');
```

Attachments
-----------

[](#attachments)

Attachment content can be appended on a mail using `Mail_Sender::attachment`. You may specify an array of headers specific to that attachment.

Mail with attachment(s) will be automatically converted to multipart format.

```
Mailer::factory()
    ->subject('Got a new cat picture for you.')
    ->attachment(file_get_contents('cat.png'), array(
        'Content-Type' => 'image/png',
        'Content-Disposition' => 'attachment; filename=cat.png')
    ->send('foo@example.com');
```

Receivers
---------

[](#receivers)

Receivers must comply with the following format:

A simple email

```
$receiver = "john@example.com"; # a simple email
$receivers = array("john@example.com", "james@example.com"); # a list of emails
$receivers = array("john@example.com" => "John Doe # an associative array
$receivers = array("john@example.com", "james@example.com" => "James Doe"); # a mixed array
```

It is pretty convenient with the ORM

```
$receivers = ORM::factory('user')
    ->find_all()
    ->as_array('email', 'full_name');

Mailer::factory()
    ->reply_to('noreply@example.com')
    ->body('Hey guys!')
    ->send($receivers);
```

Sending heavy mail
------------------

[](#sending-heavy-mail)

You can send heavy mail using `register_shutdown_function`:

```
register_shutdown_function(array($mailer, 'send'), $users);
```

Mail will be sent after the user get his response.

Generating Message-ID
---------------------

[](#generating-message-id)

There is a message id implementation based on [Matt Curtin &amp; Jamie Zawinski recommendations](http://www.jwz.org/doc/mid.html). It generates secure identifier to make threads and other fancy mailing stuff.

```
Mailer::factory()
    ->in_reply_to(Mailer::message_id())
    ->body('Hey Foo, long time no see!')
    ->send('foo@example.com')
```

Testing mail
------------

[](#testing-mail)

The module provides a Mock sender to make efficient testing. Mails are pushed in a stack `Mail_Sender_Mock::$history` so that you can retreive them and test their content.

```
public function testMail()
{
    // self-request to send a mail
    Request::factory('send')->execute();

    $mail = array_pop(Mail_Sender_Mock::$history);

    $this->assertEquals('text/html', $mail->headers('Content-Type'));
    $this->assertContains('foo@example.com', $mail->to);

    $this->assertTag(array('tag' => 'a', 'attributes' => array('href' => 'http://example.com')), $mail->body());
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/82d9215a6f54e35a9f692e1af22614f195b5d49f38049eb0fe882818592b4604?d=identicon)[arteymix](/maintainers/arteymix)

---

Top Contributors

[![arteymix](https://avatars.githubusercontent.com/u/1318477?v=4)](https://github.com/arteymix "arteymix (214 commits)")[![316k](https://avatars.githubusercontent.com/u/4315554?v=4)](https://github.com/316k "316k (2 commits)")[![paulwillyjean](https://avatars.githubusercontent.com/u/1850486?v=4)](https://github.com/paulwillyjean "paulwillyjean (2 commits)")

### Embed Badge

![Health badge](/badges/hete-mail/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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