PHPackages                             wasabi/wasabimail - 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. wasabi/wasabimail

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

wasabi/wasabimail
=================

Zend Framework 2 Email Module Service. This Email module enhances ZF2 email functionality for a convenient usage. It supports file attachments and template email composition. It is bundled with a responsive email template that can be customized.

1.4(10y ago)020421MIT LicenseHTMLPHP ~5.4|~7.0

Since Jan 21Pushed 8y ago3 watchersCompare

[ Source](https://github.com/WasabiLib/Mail)[ Packagist](https://packagist.org/packages/wasabi/wasabimail)[ Docs](https://github.com/wasabiLib/mail)[ RSS](/packages/wasabi-wasabimail/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (11)Versions (5)Used By (1)

Wasabi Mail Module for Zend Framework 2
=======================================

[](#wasabi-mail-module-for-zend-framework-2)

[![Latest Stable Version](https://camo.githubusercontent.com/1924291c29eaa59a44762ca78367a79b10672feac71fabbe3bf8cd886874f2ed/68747470733a2f2f706f7365722e707567782e6f72672f7761736162692f7761736162696d61696c2f762f737461626c65)](https://packagist.org/packages/wasabi/wasabimail) [![Total Downloads](https://camo.githubusercontent.com/aee7ac41053eb9e2f5b3e447ae975df31853d29fe665cbd3e69c7950239647b5/68747470733a2f2f706f7365722e707567782e6f72672f7761736162692f7761736162696d61696c2f646f776e6c6f616473)](https://packagist.org/packages/wasabi/wasabimail) [![Latest Unstable Version](https://camo.githubusercontent.com/650de645fe1b72ba58b04b3c928819d202e25d47a89301b87f3e24d3c80fcf2d/68747470733a2f2f706f7365722e707567782e6f72672f7761736162692f7761736162696d61696c2f762f756e737461626c65)](https://packagist.org/packages/wasabi/wasabimail) [![License](https://camo.githubusercontent.com/0ed5544d00ab9094d3874fe66decc1283757a94151482e033d26a82ebfc263d3/68747470733a2f2f706f7365722e707567782e6f72672f7761736162692f7761736162696d61696c2f6c6963656e7365)](https://packagist.org/packages/wasabi/wasabimail)

This Email module enhances ZF2 email functionality for a convenient usage. It supports file attachments and template email composition.

Configuration
=============

[](#configuration)

The Mail Module is configured as a service and registered to the service manager. You have 3 default *env*-types for configuration in vendor/WasabiMail/config.php:

1. **local** - sended emails are saved as text files in vendor/WasabiMail/localMails
2. **develop** - for staging or development servers. It is supposed that a Mail-Server is accessible. Emails are sended to the given address in the config.php
3. **production** - The transporter is SendMail. This can only be changed in the Module.php

You can change this behavior in the Module.php if necessary.

Setting the Environment type
----------------------------

[](#setting-the-environment-type)

It is recommended to set the *env*-type in the local.php of the config-folder. Normaly this file will not be deployed and should differ from the specific server environment.

### Copy the following code into the local.php

[](#copy-the-following-code-into-the-localphp)

```
 "env" => array(
     "type" => "local"
    #"type" => "develop"
    #"type" => "production"
 ),

```

Make sure that only one type is active.

Examples
========

[](#examples)

Simple Usage
------------

[](#simple-usage)

```
$mail = $this->getServiceLocator()->get("Mail");
$mail->setBody("Hello World");
$mail->setTo("recipient@domain.com");
$mail->send();

```

Using Html Templates
--------------------

[](#using--html-templates)

Using a template for sending emails is based on the ViewModel approach of ZF2. You only need to create a new ZF2 *ViewModel* instance, set your template, fill in your variables and pass it to the setBody method of the Mail Module.

**WasabiMail is bundled with a *responsive* Html Email-Template that you can customize for your own needs.**This template is tested with common email clients like Microsoft Outlook or Google Mail.

```
$mail = $this->getServiceLocator()->get("Mail");
$viewModel = new ViewModel();
$viewModel->setTemplate("responsive");
$mail->setBody($viewModel);
$mail->send();

```

The template path stack is set to WasabiMail/templates. If necessary you can change this in the config.php

File Attachments
----------------

[](#file-attachments)

Files can be attached to the email before sending it by providing their paths with `addAttachment` the method.

### Usage

[](#usage)

```
$mail->addAttachment('data/mail/attachments/file1.pdf');

```

You can call the method for each attachment you want to attach. You can use the second argument for another name of the file you want to attach. Otherwise the real file name will be used.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3792d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3932886281df18e138361e4c1d97850b379f008d57490fe96a3f06aa24967009?d=identicon)[wasabiNorman](/maintainers/wasabiNorman)

---

Tags

phpemailzendmodulezf2wasabilibZF2 mail service

### Embed Badge

![Health badge](/badges/wasabi-wasabimail/health.svg)

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

###  Alternatives

[mtymek/mt-mail

Zend Framework e-mail module. Using this library can easily create e-mail messages from PHTML templates (with optional layouts) and send them using configurable transports. Pluggable, EventManager-driven architecture allows you to customize every aspect of the process.

1839.5k3](/packages/mtymek-mt-mail)[davidhavl/dherrorlogging

Full featured error logging module for ZF2/ZF3 application

1924.6k](/packages/davidhavl-dherrorlogging)

PHPackages © 2026

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