PHPackages                             taq/delayedmail - 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. taq/delayedmail

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

taq/delayedmail
===============

Queue email messages in files to send them later

1.0.5(10y ago)3231GPLPHPPHP &gt;=5.3.0

Since Sep 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/taq/delayedmail)[ Packagist](https://packagist.org/packages/taq/delayedmail)[ Docs](http://github.com/taq/delayedmail)[ RSS](/packages/taq-delayedmail/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

Delayed Mail for PHP
====================

[](#delayed-mail-for-php)

This is a simple app for sending emails through PHP without blocking sending and waiting answer from the SMTP server. It provides some classes as:

- `Message` to compose the message
- `Server` to connect to the SMTP server
- `Sender` to run and send the queued messages
- `Runner` to fire a Sender object

How it works
------------

[](#how-it-works)

First we need the server configurations. There is a sample file on the `test`dir, called `delayedmail.ini`:

```
host = smtp.gmail.com
port = 587
user = taq
password = secret
path = /tmp/delayedmailtest

```

The only different parameter there is the `path` parameter. This is where the mail files will be stored.

**VERY IMPORTANT**

If you use two-phase authentication on a Gmail account, **sending emails with this library will not work**. You need a less secure account to make it works.

Storing messages to send later
------------------------------

[](#storing-messages-to-send-later)

The data store used are just regular plain text files. They are stored on the `path` configured above. On that dir there will be another two subdirs:

- `delivery` where the queued messages are.
- `sent`, where the messages are moved *after* `Sender` send them.
- `error`, where the messages are moved if there are some errors on them.

How to use it
-------------

[](#how-to-use-it)

### Queuing messages

[](#queuing-messages)

Just include the `delayedmail.php` on your app, create a new `Server` object, configure it, compose and queue a new message:

```

```

If you check the `delivery` dir now, there will be a file there with the message contents.

You can use arrays on `attach` and `cc`.

### Running the runner

[](#running-the-runner)

Just edit the `runner.php` file with the desired interval and configuration file (usually the same config file as the server) and run it from the command line:

```

```

```
$ php runner.php
- initializing ...
- checking for files in /tmp/delayedmailtest/delivery ...
- no files found.
```

Testing
-------

[](#testing)

### Sending emails

[](#sending-emails)

Go to the `test` directory, configure the `delayedmail.ini` and `test.php` files to the configs you want, and run:

```
$ php test.php

```

And then check your email app on the addresses you configured.

### Code

[](#code)

Run `composer update`, go to the `test` directory and run:

```
$ phpunit .

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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

Every ~310 days

Total

4

Last Release

3690d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/273db918d5bd2c20b61a40797df70fdbee387de22e2c1dd75419868048980d30?d=identicon)[taq](/maintainers/taq)

---

Top Contributors

[![taq](https://avatars.githubusercontent.com/u/9789?v=4)](https://github.com/taq "taq (43 commits)")

---

Tags

backgroundemailphpemailqueuebackground

### Embed Badge

![Health badge](/badges/taq-delayedmail/health.svg)

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

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[nterms/yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer.

87129.2k2](/packages/nterms-yii2-mailqueue)[lorenzo/cakephp-email-queue

Queue, preview and and send emails stored in the database

57121.5k1](/packages/lorenzo-cakephp-email-queue)[rmrevin/yii2-postman

Mail module for Yii2.

2612.3k](/packages/rmrevin-yii2-postman)[tigrov/yii2-mailqueue

Yii2 mail queue component for yii2-swiftmailer.

186.1k](/packages/tigrov-yii2-mailqueue)

PHPackages © 2026

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