Skip to content

Why WireMailPHPMailer?

ProcessWire’s default WireMail falls back to PHP’s native mail() function, which lacks authenticated SMTP, XOAUTH2, DKIM signing, and reliable deliverability on cloud hosts. Meanwhile, instantiating PHPMailer manually in templates breaks ProcessWire’s $wire->mail->new() ecosystem used by core password resets, Account, Forms, Campaign, and Charter.

WireMailPHPMailer vs. Native PHP mail() & Raw Scripts

Section titled “WireMailPHPMailer vs. Native PHP mail() & Raw Scripts”
Capability Default WireMail (mail()) Raw PHPMailer in Templates WireMailPHPMailer
Ecosystem compatibility Native $wire->mail->new() Bypassed by core & modules Drop-in WireMail transport for core & all first-party modules
SMTP / DSN / XOAUTH2 Not supported Manual boilerplate per script Built-in smtp:///smtps:// DSN, STARTTLS/SMTPS, and OAuthProvider (Google, Microsoft, Azure, Yahoo)
DKIM signing Not supported Manual key loading Native TabDKIM config with write-only masked private keys and passphrases
Secret & log safety N/A Easy to leak SMTP credentials in logs Write-only masked inputs, _clear_secrets, and redactDsnCredentials()
Attachment security Basic Raw filesystem paths Rejects stream wrappers, null bytes, .., symlinks, and site/config*.php
Demo mode & testing Sends live mail Hard to intercept Respects $config->demo and supports setMailer() test doubles

Next steps