PHPackages                             jack33232/zjemailservice - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jack33232/zjemailservice

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

jack33232/zjemailservice
========================

Wrap PHPMailer for easier using.

0.0.1(8y ago)010MITPHPPHP &gt;=5.5.0

Since Mar 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jack33232/ZJEmailService)[ Packagist](https://packagist.org/packages/jack33232/zjemailservice)[ RSS](/packages/jack33232-zjemailservice/feed)WikiDiscussions master Synced yesterday

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

About ZJEmailService
====================

[](#about-zjemailservice)

> This is a library combining the powerful ["PHPMailer"](https://github.com/PHPMailer/PHPMailer) and semantic Classes to help you get a easier use experience when try to send emails in your PHP applications.

Dependency
----------

[](#dependency)

```
{
  "php": ">=5.5.0",
  "phpmailer/phpmailer": "~6.0",
  "psr/log": "~1.0"
}
```

Usage
-----

[](#usage)

> Register Email Postbox

Before using a email postbox, it is necessary to register one by giving a setting array (Refer to PHPMailer Doc), an optional name of the postbox and an optional PSR logger as a debugger. By default, the name of the postbox is "**default**". As for PSR logger, here is a recommended library: [KLogger](https://github.com/jack33232/KLogger).

```
use ZJEmailService\EmailPostbox;
use Katzgrau\KLogger\Logger;

// All possible settings, please refer to PHPMailer Doc
$postbox_setting = [
  'Host' => 'example.exchange.com',
  'Port' => 25,
  'ContentType' => 'text/html',
  'SMTPAuth' => true,
  'SMTPSecure' => 'tls',
  'CharSet' => 'UTF-8',
  'Encoding' => 'base64',
  'SMTPOptions' => array(),
  'Timeout' => 300,
  'SMTPDebug' => 0,
  'Debugoutput' => 'error_log' // only works when no debugger assigned
];
// Postbox name
$postbox_name = 'example';
// PSR logger
$debugger = new Logger(__DIR__.'/logs');
EmailPostbox::register($postbox_setting, $postbox_name, $debugger);
```

> Unlock the postbox

After register a postbox, you should use a username &amp; password of that SMTP to unlock that postbox. Then you can use an instance of postbox to send emails.

```
use ZJEmailService\EmailPostbox;

$username = 'username@emample.com';
$password = 'password123';
$from = 'Username';
$postbox_name = 'example';
// The postbox is a singleton
$postbox = EmailPostbox::unlock($username, $password, $from, $postbox_name);
```

> Compose email to an **Envelope** object

Every email in ZJEmailService library is transformed into a **Envelope** object. An **Envelope** can be set the content, subject, to, cc, bcc, attachments and so on. The object is array accessing.

```
use ZJEmailService\Envelope;

// Third parameter is the priority of the email
$envelope = new Envelope('Test', 'Some text as email body', 'HIGH');
$envelope->setTo(['to@example.com', 'To Name']);

$postbox->send($envelope);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

2977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dd422d180eac7aaa243019c6238b692f5dcdf68760b70e9decf46c6fbbbbe4a?d=identicon)[jack33232](/maintainers/jack33232)

---

Top Contributors

[![maczhuo](https://avatars.githubusercontent.com/u/1715921?v=4)](https://github.com/maczhuo "maczhuo (2 commits)")

### Embed Badge

![Health badge](/badges/jack33232-zjemailservice/health.svg)

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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