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

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

misarji/ez-mail
===============

Integration of various email service providers in the Zend Framework Zend\\Mail

1.0.0(11y ago)0590BSD-3-ClausePHPPHP &gt;=5.3.3

Since Feb 23Pushed 11y agoCompare

[ Source](https://github.com/misarji/ez-mail)[ Packagist](https://packagist.org/packages/misarji/ez-mail)[ Docs](https://github.com/misarji/EzMail)[ RSS](/packages/misarji-ez-mail/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

EzMail
======

[](#ezmail)

Created by Keshav Mishra

> Note that API calls are not currently unit-tested (although we have properly test them manually). Therefore, you are encouraged to test your API usage before going into production.

Introduction
------------

[](#introduction)

EzMail is a module that integrates with various third-parties API to send mails. Integration is provided with the API of those services. It does not handle SMTP.

Please note that EzMail only supports Transactional services. Services for campaign marketing emails (like MailChimp or MailJet) are out-of-the scope of this module.

Here are the currently supported services:

- [Amazon SES](http://aws.amazon.com/ses) (nearly complete)
- [Elastic Email](http://elasticemail.com) (complete)
- [Mailgun](http://www.mailgun.com) (complete)
- [Mandrill](http://mandrill.com) (complete)
- [Postmark](https://postmarkapp.com) (complete)
- [Postage](http://postageapp.com) (complete)
- [Send Grid](http://sendgrid.com) (nearly complete)

Requirements
------------

[](#requirements)

- PHP 5.3
- [Zend Framework 2](https://github.com/zendframework/zf2)
- [Amazon AWS ZF 2 Module](https://github.com/aws/aws-sdk-php-zf2): only if you plan to use Amazon SES service

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

[](#installation)

Add `"misarji/ez-mail"` to your `composer.json` file and update your dependencies. Enable `EzMail` in your `application.config.php`. To use one of the transport layers, see the documentation in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

If you do not have a `composer.json` file in the root of your project, copy the contents below and put that into a file called `composer.json` and save it in the root of your project:

```
{
    "require": {
        "misarji/ez-mail": "~1.5"
    }
}

```

Then execute the following commands in a CLI:

```
curl -s http://getcomposer.org/installer | php
php composer.phar install

```

Now you should have a `vendor` directory, including a `misarji/ez-mail`. In your bootstrap code, make sure you include the `vendor/autoload.php` file to properly load the EzMail module.

### Amazon SES

[](#amazon-ses)

If you want to use Amazon SES, you need to install the official AWS ZF 2 module. Please refer to the documentation of Amazon SES in the [docs](https://github.com/misarji/EzMail/tree/master/docs) folder.

Documentation
-------------

[](#documentation)

Documentation for EzMail is splitted for each provider:

- [Amazon SES](/docs/Ses.md)
- [Elastic Email](/docs/ElasticEmail.md)
- [Mailgun](/docs/Mailgun.md)
- [Mandrill](/docs/Mandrill.md)
- [Postage](/docs/Postage.md)
- [Postmark](/docs/Postmark.md)
- [SendGrid](/docs/SendGrid.md)

Cook-book
---------

[](#cook-book)

### How to send an HTML email ?

[](#how-to-send-an-html-email-)

Every email providers used in EzMail allow to send HTML emails. However, by default, if you set the mail's content using the `setBody` content, this content will be considered as the plain text version as shown below:

```
$message = new \Zend\Mail\Message();

// This will be considered as plain text message, even if the string is valid HTML code
$message->setBody('Hello world');
```

To send a HTML version, you must specify the body as a MimeMessage, and add the HTML version as a MIME part, as shown below:

```
$message = new \Zend\Mail\Message();

$htmlPart = new \Zend\Mime\Part('Hello world');
$htmlPart->type = "text/html";

$textPart = new \Zend\Mime\Part('Hello world');
$textPart->type = "text/plain";

$body = new \Zend\Mime\Message();
$body->setParts(array($textPart, $htmlPart));

$message->setBody($body);
```

> For accessibility purposes, you should *always* provide both a text and HTML version of your mails.

### How to configure HttpClient with http\_options and http\_adapter

[](#how-to-configure-httpclient-with-http_options-and-http_adapter)

By defaut the adapter is Zend\\Http\\Client\\Adapter\\Socket but you can override it with other adapter like this in your ez\_mail.\*.local.php

```
'ez_mail' => array(
        // Here your email service provider options

        'http_adapter' => 'Zend\Http\Client\Adapter\Proxy' // for example
    )
```

If you want to change some options of your adapter please refer to you adapter class in var $config [here](https://github.com/zendframework/zf2/tree/master/library/Zend/Http/Client/Adapter) and override these in your ez\_mail.\*.local.php like this :

```
'ez_mail' => array(
        // Here your email service provider options

        // example for Socket adapter
        'http_options' => array(
            'sslverifypeer' => false,
            'persistent' => true,
        ),
    )
```

### Which provider should I choose?

[](#which-provider-should-i-choose)

We won't answer you :-)! Each provider have their own set of features. You should carefully read each website to discover which one suit your needs the most.

However, for convenience purpose, we [have wrapped a pricing table](/docs/Pricing.md) for each email provider!

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

4148d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20325705?v=4)[Keshav Mishra](/maintainers/misarji)[@misarji](https://github.com/misarji)

---

Tags

emailsendgridmailgunzf2mandrillpostmarkelastic emailpostageelasticemailsend gridtransactional email

### Embed Badge

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

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

###  Alternatives

[slm/mail

Integration of various email service providers in the Laminas\\Mail

109745.7k1](/packages/slm-mail)[omnimail/omnimail

PHP Library to send email across all platforms using one interface.

33235.4k](/packages/omnimail-omnimail)[sendgrid/sendgrid

This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.

1.6k50.9M190](/packages/sendgrid-sendgrid)[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.

2039.6k3](/packages/mtymek-mt-mail)[azine/mailgunwebhooks-bundle

Symfony2 Bundle to easily capture feedback from mailgun.com via their provided webhooks

104.2k](/packages/azine-mailgunwebhooks-bundle)

PHPackages © 2026

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