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

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

jiaojie/pop-mail
================

Pop Mail Component for Pop PHP Framework. Patch for PHP version 5.3

0.1.0(9y ago)045New BSDPHPPHP &gt;=5.3.0

Since Sep 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jiaojie1989/pop-mail)[ Packagist](https://packagist.org/packages/jiaojie/pop-mail)[ Docs](http://www.popphp.org/)[ RSS](/packages/jiaojie-pop-mail/feed)WikiDiscussions master Synced 3w ago

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

pop-mail
========

[](#pop-mail)

[![Build Status](https://camo.githubusercontent.com/7f823398b7b8f0120c334b25251995e649a6ea26d16a5c37a1247473977b8de0/68747470733a2f2f7472617669732d63692e6f72672f706f707068702f706f702d6d61696c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/popphp/pop-mail)[![Coverage Status](https://camo.githubusercontent.com/3964a859c9feb1ba727e2bc64ed8112c01ff5842530282454cf98ed6e876edb0/687474703a2f2f7777772e706f707068702e6f72672f63632f636f7665726167652e7068703f636f6d703d706f702d6d61696c)](http://www.popphp.org/cc/pop-mail/)

OVERVIEW
--------

[](#overview)

`pop-mail` is a component for managing and sending email messages. It has a full feature set that supports:

- Send to multiple emails
- Send as group
- Manage headers
- Attach files
- Send multiple mime-types (i.e., text, HTML, etc.)
- Save emails to be sent later

`pop-mail` is a component of the [Pop PHP Framework](http://www.popphp.org/).

INSTALL
-------

[](#install)

Install `pop-mail` using Composer.

```
composer require popphp/pop-mail

```

BASIC USAGE
-----------

[](#basic-usage)

### Sending a basic email

[](#sending-a-basic-email)

```
use Pop\Mail\Mail;

$mail = new Mail('Test Email Subject');

$mail->to('test@test.com');
$mail->cc('cc@test.com');
$mail->from('somebody@test.com');

$mail->setText('Hello World! This is a test email.');

$mail->send();
```

```
To: test@test.com
Subject: Test Email Subject
Cc: cc@test.com
From: somebody@test.com
Reply-To: somebody@test.com
Content-Type: text/plain; charset=utf-8

Hello World! This is a test email.

```

### Attaching a file

[](#attaching-a-file)

```
use Pop\Mail\Mail;

$mail = new Mail('Attaching a File');

$mail->to('test@test.com');
$mail->from('somebody@test.com');

$mail->setText('Check out this file.');
$mail->attachFile('lorem.docx');

$mail->send();
```

```
To: test@test.com
Subject: Attaching a File
From: somebody@test.com
Reply-To: somebody@test.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="7dbf357ee8df3d00a00cda688da71a8523f8123c"
This is a multi-part message in MIME format.

--7dbf357ee8df3d00a00cda688da71a8523f8123c
Content-Type: file; name="lorem.docx"
Content-Transfer-Encoding: base64
Content-Description: lorem.docx
Content-Disposition: attachment; filename="lorem.docx"

UEsDBBQACAgIAKmB9UYAAAAAAAAAAAAAAAALAAAAX3JlbHMvLnJlbHOtkk1LA0EMhu/9FUPu3Wwr
iMjO9iJCbyL1B4SZ7O7Qzgczaa3/3kEKulCKoMe8efPwHNJtzv6gTpyLi0HDqmlBcTDRujBqeNs9
[ ... Big long block of base 64 encoded data ... ]
L2NvcmUueG1sUEsBAhQAFAAICAgAqYH1RhkaEIMtAQAAXgQAABMAAAAAAAAAAAAAAAAAcRAAAFtD
b250ZW50X1R5cGVzXS54bWxQSwUGAAAAAAkACQA8AgAA3xEAAAAA

--7dbf357ee8df3d00a00cda688da71a8523f8123c
Content-type: text/plain; charset=utf-8

Check out this file.

--7dbf357ee8df3d00a00cda688da71a8523f8123c--

```

### Sending an HTML and text-based email

[](#sending-an-html-and-text-based-email)

```
$mail = new Mail('Sending an HTML Email');

$mail->to('test@test.com');
$mail->from('somebody@test.com');

$html = send();
```

```
To: test@test.com
Subject: Sending an HTML Email
From: somebody@test.com
Reply-To: somebody@test.com
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="d08ae99249fe6d0a03a8436ce3bea4ceffd208cb"
This is a multi-part message in MIME format.

--d08ae99249fe6d0a03a8436ce3bea4ceffd208cb
Content-type: text/plain; charset=utf-8

This is the text message in case your email client cannot display HTML.

--d08ae99249fe6d0a03a8436ce3bea4ceffd208cb
Content-type: text/html; charset=utf-8

Hello World!

Hello World!
This is a cool HTML email, huh?

--d08ae99249fe6d0a03a8436ce3bea4ceffd208cb--

```

### Saving an email to send later

[](#saving-an-email-to-send-later)

```
use Pop\Mail\Mail;

$mail = new Mail('Test Email Subject');

$mail->to('test@test.com');
$mail->cc('cc@test.com');
$mail->from('somebody@test.com');

$mail->setText('Hello World! This is a test email.');
$mail->saveTo(__DIR__ . '/email-queue');
```

That will write the email or emails to a file in the folder. Then, when you're ready to send them, you can simply do this:

```
use Pop\Mail\Mail;

$mail = new Mail();
$mail->sendFrom(__DIR__ . '/email-queue', true);
```

The `true` parameter is the flag to delete the email from the folder once it's sent.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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

3584d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/603167de95d08f2a3edaf5acc3545be0e293566e84bddf4e9b5010aa0e52f6f3?d=identicon)[jiaojie1989](/maintainers/jiaojie1989)

---

Top Contributors

[![jiaojie1989](https://avatars.githubusercontent.com/u/8794115?v=4)](https://github.com/jiaojie1989 "jiaojie1989 (3 commits)")

---

Tags

phpmailpoppop phpsend mailmail queue

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[railsware/mailtrap-php

The Mailtrap SDK provides methods for all API functions.

59879.6k](/packages/railsware-mailtrap-php)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

28137.9k3](/packages/henrique-borba-php-sieve-manager)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3518.7k](/packages/benhall14-php-imap-reader)[shuchkin/react-smtp-client

ReactPHP async SMTP Client

245.9k](/packages/shuchkin-react-smtp-client)[juanparati/brevosuite

Complete Brevo integration with Laravel

1013.2k](/packages/juanparati-brevosuite)

PHPackages © 2026

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