About WireMail: PHPMailer

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

Category Email/WireMail
Modules that work with email as well as modules that implement ProcessWire’s core WireMail type.
Release StateBeta
Close to stable, but users are advised to be cautious and test thoroughly.*
Authorukyo
Module Version1.0.7
Class NameWireMailPHPMailer
Compatibility3.0
Date AddedJune 3, 2016
Last UpdatedNovember 29, 2018
Recommended ByNew recommendations may take up to 1 day to appear.

Instructions

This module's files should be placed in /site/modules/WireMailPHPMailer/
How to install or uninstall modules

README

WireMailPHPMailer

This module extends WireMail base class, integrating the PHPMailer mailing library into ProcessWire.The module using PHPMailer 6.0.3. 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

$mail = wire("modules")->get("WireMailPHPMailer");
$mail = $mail->mailer();
$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();

Comments

No comments yet. Be the first to post!

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.