WireMailPHPMailer by ukyo (@trk)

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

WireMailPHPMailer

This module extends WireMail base class, integrating the PHPMailer mailing library into ProcessWire.The module using PHPMailer. You can see an example usage below.

Simple example

Other examples

Wiki

You can set your configs from module settings or you can directly call $mail = wire("modules")->get("WireMailPHPMailer"); $mail = $mail->mailer(); function for new PHPMailer() instance.

Using Directly PHPMailer library


/** @var WireMailPHPMailer $mail */
$mail = wire("modules")->get("WireMailPHPMailer");
// load module without module configs
/** @var PHPMailer $mail */
$mail = $mail->getInstance(false);
$mail = wire("modules")->get("WireMailPHPMailer");
$mail = $mail->getInstance();
$mail->addAddress("email@domain.ltd", "Someone");
$mail->isHTML(true);
$mail->Subject = "WireMailPHPMailer";
$html = "<h1>WireMailPHPMailer</h1>";
$text = "WireMailPHPMailer";
$mail->Body    = $html;
$mail->AltBody = $text;
$mail->send();

Using Like classic WireMail method


$mail = wire("modules")->get("WireMailPHPMailer");
$mail->from("from@domain.ltd")
    ->fromName("A From Name")
    ->to('email@domain.ltd')
    ->subject('A Message Subject')
    ->body('A Message Body')
    ->bodyHtml("<h1>A HTML Message Body</h1>")
    ->send();

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #554
    In the 554th issue of ProcessWire Weekly we'll check out the latest core updates, introduce a couple of new third party modules, and more. Read on!
    Weekly.pw / 21 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH