WireMailSmtp by Horst Nogajski

extends WireMail, uses SMTP protocol (plain | ssl | tls), provides: to, cc, bcc, attachments, priority, disposition notification, bulksending, ...

WireMailSmtp

ProcessWire: a extension to the WireMail base class that uses SMTP-transport

Formerly usable with ProcessWire version 2.4.1 or greater, changed since module version 0.8.0 to ProcessWire version 3.0.62 or greater

This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire

More information and code examples


Current Version 0.8.0

List of all options and features

testConnection () - returns true on success, false on failures

debugSend () - send the mail(s) and output or return verbose messages of the complete connection and sending process

sendSingle ( true | false ) - default is false

sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+)

to ($recipients) - one emailaddress or array with multiple emailaddresses

cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses

bcc ($recipients) - one emailaddress or array with multiple emailaddresses

from = 'person@example.com' - can be set in module config (called Sender Emailaddress) but it can be overwritten here

fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here

priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest

dispositionNotification () or notification () - request a Disposition Notification

subject ($subject) - subject of the message

body ($textBody) - use this one alone to create and send plainText emailmessages

bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback)

addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here. (only available if a signature is defined in the config screen)

attachment ($filename, $alternativeBasename = '') - add attachment file

send () - send the mail(s) and return number of successful send messages

getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses,

logActivity ($logmessage) - you may log success if you want

logError ($logmessage) - you may log errors, too. - Errors are also logged automaticaly

useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods

sentLogReset () - starts a new Session. Best usage would be interactively once when setting up a new Newsletter

sentLogGet () - returns an array containing all previously used emailaddresses

sentLogAdd ($emailaddress) - is called automaticly within the send() method

wrapText (true|false) - default is true

More information and code examples

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

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani