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 #522
    In the 522nd issue of ProcessWire Weekly we'll check out the latest core updates, introduce a new module called File Mover, and more. Read on!
    Weekly.pw / 11 May 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits