PHPackages                             trk/processwire-php-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. trk/processwire-php-mailer

ActivePw-module[Mail &amp; Notifications](/categories/mail)

trk/processwire-php-mailer
==========================

This module extends WireMail base class, integrating the PHPMailer mailing library into ProcessWire.

v1.4.4(2mo ago)42MITPHPPHP &gt;=7.0CI passing

Since Mar 29Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/trk/WireMailPHPMailer)[ Packagist](https://packagist.org/packages/trk/processwire-php-mailer)[ Docs](https://github.com/trk/WireMailPHPMailer)[ Patreon](https://www.patreon.com/ukyo)[ RSS](/packages/trk-processwire-php-mailer/feed)WikiDiscussions master Synced 1mo ago

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

WireMailPHPMailer
=================

[](#wiremailphpmailer)

A robust, modern integration of the popular [PHPMailer](https://github.com/PHPMailer/PHPMailer) library for the ProcessWire CMS/CMF. This module transparently extends the core `WireMail` class, allowing you to use advanced mailing features via familiar API calls, or access the native `PHPMailer` instance directly for fine-grained control.

Requirements
------------

[](#requirements)

- **ProcessWire:** `3.0.0` or newer
- **PHP:** `8.0` or newer (Strict Types enforced)

Installation
------------

[](#installation)

1. Copy the module files into your `site/modules/WireMailPHPMailer/` directory.
2. In the ProcessWire admin, go to **Modules &gt; Refresh**.
3. Locate **WireMailPHPMailer** under the *WireMail* section and click **Install**.
4. Configure your SMTP, Sendmail, or PHP Mail settings directly via the module's configuration screen.

*(Note: The module comes pre-packaged with the PHPMailer library in the `vendor` directory. You do not need to run Composer manually unless you are doing custom developmental modifications.)*

Usage
-----

[](#usage)

You can use the module through the standard ProcessWire `WireMail` API or access the underlying `PHPMailer` instance directly.

### 1. The Classic WireMail Way (Recommended)

[](#1-the-classic-wiremail-way-recommended)

This approach seamlessly integrates into existing ProcessWire core API workflows.

```
$mail = wire('modules')->get('WireMailPHPMailer');

$mail->from('from@example.com')
     ->fromName('Sender Name')
     ->to('to@example.com')
     ->subject('Your Subject Here')
     ->body('This is the plain-text message body.')
     ->bodyHTML('This is the HTML message body')
     ->send();
```

### 2. The Native PHPMailer Way

[](#2-the-native-phpmailer-way)

If you need advanced configuration, attachments, or specific PHPMailer features, you can interact with the instance directly.

```
/** @var WireMailPHPMailer $wireMail */
$wireMail = wire('modules')->get('WireMailPHPMailer');

// Retrieve the initialized PHPMailer instance
// (passing `false` skips loading the module configurations if needed)
$mail = $wireMail->getInstance();

$mail->addAddress('email@domain.ltd', 'Recipient Name');
$mail->isHTML(true);
$mail->Subject = 'Advanced PHPMailer Usage';
$mail->Body    = 'Hello WorldProcessWire + PHPMailer';
$mail->AltBody = 'Hello World - ProcessWire + PHPMailer';

if ($mail->send()) {
    echo "Message has been sent.";
} else {
    echo "Message could not be sent. Mailer Error: " . $mail->ErrorInfo;
}
```

Features &amp; Configuration
----------------------------

[](#features--configuration)

The module provides an extensive settings page in the ProcessWire admin (`Modules > Configure > WireMailPHPMailer`) where you can define:

- **Transport method:** SMTP, Sendmail, or native `mail()`
- **SMTP credentials:** Host, Port, Username, Password, AutoTLS (enabled by default)
- **Encryption:** SSL / TLS
- **Authentication Types:** LOGIN, PLAIN, CRAM-MD5, and native **XOAUTH2** support.
- **DKIM Signing:** Domain, Identity, Selector, Path to Private Key
- **Global Defaults:** Default Sender (`From`/`FromName`), Reply-To, and Bcc tracking.

XOAUTH2 (Google, Microsoft, Yahoo, Azure) Support
-------------------------------------------------

[](#xoauth2-google-microsoft-yahoo-azure-support)

WireMailPHPMailer supports natively injecting XOAUTH2 authentication directly into ProcessWire's unified `WireMail` flow via the underlying PHPMailer engine.

Because OAuth2 providers are heavy, this module allows you to selectively install the right provider package to the root workspace using Composer, keeping the module core lightweight.

### 1. Install an OAuth2 Provider Library

[](#1-install-an-oauth2-provider-library)

From your ProcessWire project root (where the main `composer.json` is located), require the provider:

- **For Google:** `composer require league/oauth2-google`
- **For Yahoo:** `composer require hayageek/oauth2-yahoo`
- **For Microsoft:** `composer require stevenmaguire/oauth2-microsoft`
- **For Azure:** `composer require greew/oauth2-azure-provider`

### 2. Configure XOAUTH2 Settings

[](#2-configure-xoauth2-settings)

1. Go to **Modules &gt; Configure &gt; WireMailPHPMailer**.
2. Select **XOAUTH2** under `Auth Type`.
3. Fill out the **OAuth2 Settings** block that appears below it:
    - Select the **OAuth Provider** (Google, Yahoo, Microsoft, or Azure).
    - Enter your **OAuth Email** (the account initiating sending).
    - Provide your **Client ID** and **Client Secret**.
    - *(Azure Only)* Specify your **Tenant ID** (or leave default `common`).
4. **Save** the module settings.

### 3. Generate a Refresh Token

[](#3-generate-a-refresh-token)

After saving your `Client ID` and `Client Secret`, an **Authorize via {Provider}** button will appear in the settings.

1. Click the authorization button.
2. Follow the prompt to consent and log into your provider account.
3. You will be redirected back securely to the module's setup page, where the module automatically pulls and saves your **Refresh Token**.

That's it! WireMailPHPMailer will intercept ProcessWire's Mail sends and handle token refreshes in the background natively.

Support &amp; Links
-------------------

[](#support--links)

- [PHPMailer Documentation &amp; Wiki](https://github.com/PHPMailer/PHPMailer/wiki)
- [PHPMailer Advanced Examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples)

License
-------

[](#license)

This module is free and open-source software.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance83

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~1283 days

Total

3

Last Release

86d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/455983?v=4)[Iskender TOTOĞLU](/maintainers/trk)[@trk](https://github.com/trk)

---

Top Contributors

[![trk](https://avatars.githubusercontent.com/u/455983?v=4)](https://github.com/trk "trk (74 commits)")

---

Tags

processwiremailerphp-mailer

### Embed Badge

![Health badge](/badges/trk-processwire-php-mailer/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

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

PHPackages © 2026

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