PHPackages                             jalle19/sanemail - 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. jalle19/sanemail

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

jalle19/sanemail
================

Zend Mail wrapper for those who want to preserve their sanity

1.0.0(12y ago)031MIT

Since Jul 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Jalle19/SaneMail)[ Packagist](https://packagist.org/packages/jalle19/sanemail)[ Docs](https://github.com/Jalle19/SaneMail)[ RSS](/packages/jalle19-sanemail/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SaneMail
========

[](#sanemail)

Zend Mail wrapper for those who want to preserve their sanity without having to resort to using ZF1. It provides an easy solution for sending e-mail without having to write 50 lines of code, and in contrast to doing it according to the ZF2 documentation, this way actually works.

Features
--------

[](#features)

- Does the proper magic to make sure Zend\\Mail actually uses the encoding you specify
- Always sets a plain-text version before the HTML version so that your e-mails, you know, actually display correctly
- Properly sets the correct Content-Type for e-mails containing both a plain-text and an HTML version so that, as sane people expect, the HTML version is displayed unless the user requests the plain-text version

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

[](#installation)

Install via Composer

Usage
-----

[](#usage)

```
$mail = new SaneMail\Mail();
$mail->addFrom('from@example.com', 'Disgruntled programmer');
$mail->addTo('to@example.com');
$mail->addCc('cc@example.com');
$mail->addBcc('bcc@example.com');
$mail->addReplyTo('replyto@example.com');
$mail->setSubject('This is a working e-mail');

$html = 'This is HTMLThis is a paragraph';
$text = "This is plain-text\n\nThis is a paragraph";

$mail->setBodyText($text);
$mail->setBodyHtml($html);

try {
	$mail->send();
}
catch(SaneMail\Exception $e) {
	// Zend\Mail\Exception\RuntimeException available from $e->getPrevious()
}
```

License
-------

[](#license)

This library is licensed under the MIT license

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Unknown

Total

1

Last Release

4677d ago

### Community

Maintainers

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

---

Top Contributors

[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (5 commits)")

---

Tags

zendwrapperzendmailsanemail

### Embed Badge

![Health badge](/badges/jalle19-sanemail/health.svg)

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

###  Alternatives

[stampie/stampie

Stampie is a simple API Wrapper for different email providers such as Postmark, SendGrid, Mailgun, Mandrill.

294254.8k4](/packages/stampie-stampie)[ecomailcz/ecomail

Ecomail.cz API Wrapper

17383.8k4](/packages/ecomailcz-ecomail)[anod/gmail-imap

API to work with Gmail using IMAP built on top of Zend Imap Library

728.7k](/packages/anod-gmail-imap)[thefox/smtpd

SMTP server (library) written in pure PHP.

1302.4k1](/packages/thefox-smtpd)[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.2k3](/packages/mtymek-mt-mail)

PHPackages © 2026

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