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

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

ongom/mailer
============

A PHP library that works similar to Nodemailer for node js, for sending emails.

v1.0.0(1y ago)01MITPHP

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/felixongom/Mailer)[ Packagist](https://packagist.org/packages/ongom/mailer)[ RSS](/packages/ongom-mailer/feed)WikiDiscussions main Synced today

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

Mailer
======

[](#mailer)

A PHP library that works similar to Nodemailer for node js, for sending emails.

### What is Mailer exactly.

[](#what-is-mailer-exactly)

It is what is described above, it uses [PHPMailer](https://packagist.org/packages/phpmailer/phpmailer) in the background. It can probably perform several tasks;

You're now fully equipped with a custom, flexible mail system using PHP and PHPMailer that supports:

✅ Gmail and other providers.

✅ Plain text + HTML emails.

✅ Reply-To, CC, BCC.

✅ Multiple recipients.

✅ File attachments.

✅ Inline images (e.g., logos in HTML body).

✅ Sending multiple email.

✅ Images.

Usage
-----

[](#usage)

It has two ways of using it, passing parameters as an associative array or using the Object format to assign parameters

Example Usage (Everything Included)

### 🟡 Option 1: Object Style

[](#-option-1-object-style)

```
$mailer = new Mailer([
    'service' => 'gmail',
    'auth' => [
        'user' => 'your-email@gmail.com',
        'pass' => 'your-app-password'
    ]
]);
//
$result = $mailer->send([
    'from' => 'your-email@gmail.com',
    'fromName' => 'Your Name',
    'to' => [
        ['email' => 'person1@example.com', 'name' => 'Alice'],
        ['email' => 'person2@example.com', 'name' => 'Bob']
    ],
    'cc' => 'manager@example.com',
    'bcc' => [
        ['email' => 'audit@example.com'],
        'hidden@example.com'
    ],
    'replyTo' => 'support@example.com',
    'replyToName' => 'Support Team',
    'subject' => 'Email with All Features',
    'html' => '
        Hello!
        This email has HTML, CC, BCC, attachments, and an inline image:

    ',
    'text' => 'This is the plain text version.',
    'attachments' => [
        __DIR__ . '/files/report.pdf'
    ],
    'images' => [
        [
            'path' => __DIR__ . '/images/logo.png',
            'cid' => 'logo_cid',
            'name' => 'logo.png',
            'type' => 'image/png'
        ]
    ]
]);

echo $result === true ? "Email sent successfully!" : $result;
//
```

### 🟡 Option 2: Array Style

[](#-option-2-array-style)

```
$mail = new Mailer([
    'service' => 'gmail',
    'auth' => ['user' => 'you@gmail.com', 'pass' => 'your-app-password']
]);

//

$mail->from = 'you@gmail.com';
$mail->fromName = 'Your Name';
$mail->to = [
    ['email' => 'john@example.com', 'name' => 'John'],
    'jane@example.com'
];

//
$mail->cc = 'boss@example.com';
$mail->bcc = ['secret@example.com'];
$mail->replyTo = 'reply@example.com';
$mail->replyToName = 'Reply Desk';
$mail->subject = 'Sample Email';
$mail->text = 'Plain text content';
$mail->html = 'HelloThis is HTML with logo';
$mail->attachments = [__DIR__ . '/files/invoice.pdf'];
$mail->images = [[
    'path' => __DIR__ . '/images/logo.png',
    'cid' => 'logo',
    'name' => 'logo.png',
    'type' => 'image/png'
]];

$result = $mail->send()
echo $$result === true ? "Sent!" : "Failed!";
```

The send method retrns a boolean.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance47

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

412d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34609015?v=4)[ongom](/maintainers/ongom)[@ongom](https://github.com/ongom)

---

Top Contributors

[![felixongom](https://avatars.githubusercontent.com/u/84242768?v=4)](https://github.com/felixongom "felixongom (1 commits)")

### Embed Badge

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

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[getkirby/cms

The Kirby core

1.5k584.8k473](/packages/getkirby-cms)[ivantcholakov/codeigniter-phpmailer

A CodeIgniter 3 compatible email-library powered by PHPMailer.

25214.3k](/packages/ivantcholakov-codeigniter-phpmailer)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[sproutcms/cms

Enterprise content management and framework

242.5k4](/packages/sproutcms-cms)

PHPackages © 2026

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