PHPackages                             flyingpiranhas/mailer - 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. flyingpiranhas/mailer

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

flyingpiranhas/mailer
=====================

The flyingpiranhas mailer library uses SwiftMailer to send, archive and queue emails in a fast and secure manner. See official documentation for demos.

124PHP

Since Feb 6Pushed 13y ago1 watchersCompare

[ Source](https://github.com/Swader/flyingpiranhas-mailer)[ Packagist](https://packagist.org/packages/flyingpiranhas/mailer)[ RSS](/packages/flyingpiranhas-mailer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\###FlyingPiranhas Mailer library

\###This is not for any kind of use. It's just here for composer testing, and for development purposes. I'm still heavily working on this - it's actually a port of a library I already built before.

\####Introduction The FlyingPiranhas mailer library is part of the [FlyingPiranhas](http://www.flyingpiranhas.net) wireframework. It helps [me](http://www.bitfalls.com) develop websites quickly and safely, so I thought I'd share it with the world. For more information on it and its authors, head over to the home page and read up.

\####Mailer This is the *mailer* library, meaning it focuses solely on advanced emailing functionality.

\####Usage Before sending, you must call `Mailer::setDeveloperRecipient()` on the current instance of the Mailer class. This is a safety measure - it enables sending. If you pass in an email as the parameter, that email will override all recipients and receive emails instead of the originally intended ones. This is useful for testing bulk email functionality without quasi-spamming your users. To deactivate this measure, simply call the method with no parameters.

Mailer supports "express email" functionality via the method expressMail. This method requires an array containing "to" and "body", and optionally "subject" and "from". If "from" is omitted, it should be provided via the static method `Mailer::setDefaultSender()`The expressMail method works without a Repo by default, as long as you leave the second param at false. As soon as the second param is true, it will try to archive the sent email and will fail unless you provide a Repo class for it to work with. It is important to note that the email still gets sent, only the archiving fails with an exception.

Regular email sending works via `Mailer::prepareEmail()`, but requires a Repo Just pass in the required params and call either `sendPreparedEmails` or `queuePreparedEmails`. Send will instantly send the email and archive it as sent. Queue will place it in the Repo queue for later retrieval and sending. Once a queued email was sent, it is marked as such. For more info and demos, please see the homepage and in-depth documentation (coming soon).

\####Templates and demos Apart from the main site, there's a default MySQL/MariaDB Repo in the /fp subfolder. There's also an SQL script file there (and a workbench model), which you can use to build a MySQL/MariaDB Repo. Inject the Repo into the Mailer class and you have a working MySQL Mailer implementation ready for use in any project. Alternatively, use the Repo class to build your own, and inject that one. As long as it implements the MailRepository interface, it's all good. There will also be a PostreSQL demo Repo soon in the same folder, ready for production use. Note that the current demo repos extend the adapters from fp/common.

It is recommended you keep a separate schema for the email database as it will make backups and restorations much simpler.

\####Requirements

- Php 5.4+
- Swift Mailer (add "swiftmailer/swiftmailer":"v4.3.0" (or higher) to your composer.json file's require block)
- IMAP extension for checking when you've last sent an email to a specific person
- flyingpiranhas/common

\####Installation You can install the fpmailer library with composer. Just look for flyingpiranhas/mailer on packagist.org and add it to your composer.json file for a painless installation. You can also download a zip from github and just point a regular PSR autoloader at the folder, but composer is the preferred method since it allows us to easily update the library and fix bugs and loopholes people help us discover further down the road.

\####License See LICENSE.md

\####Contributing There's a lot of @todos in the code, so feel free to take a look and submit a pull request if you fix anything. Also, we desperately need tests written. There is only one rule: follow PSR-2 as much as possible. Use other classes as examples and keep the coding style consistent.

\####Contact We're on [Twitter](http://www.twitter.com/wireframework) and I am on [Google plus](http://www.gplus.to/Swader) or at [my website](http://www.bitfalls.com).

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c1fbd2989c3dc9eba2c45f72fe4727d5cf1bde9ef6ff014c2b961e95636a6dc?d=identicon)[swader](/maintainers/swader)

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

---

Top Contributors

[![Swader](https://avatars.githubusercontent.com/u/1430603?v=4)](https://github.com/Swader "Swader (10 commits)")

### Embed Badge

![Health badge](/badges/flyingpiranhas-mailer/health.svg)

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

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[eduardokum/laravel-mail-auto-embed

Library for embed images in emails automatically

1702.0M5](/packages/eduardokum-laravel-mail-auto-embed)

PHPackages © 2026

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