Skip to content

Class CAT_Helper_Mail

webbird edited this page Apr 16, 2013 · 2 revisions

The new Mail Helper Class creates an abstraction layer between the real mailer class used and the core / modules that need to use mailing functions.

Methods

Public

Object getInstance( String $driver )

As this class works with different mailer classes, the name of the class (driver) you wish to use must be given as param to the getInstance() method. At the moment, there are two drivers available:

  • PHPMailer
  • Swift

Please note that the mailer class must be installed as an addon.

Boolean sendMail( String $fromaddress, String $toaddress, String $subject, String $message, String $fromname )

This is a driver method. Sends a mail with subject $subject to $toaddress with mail body $message.

$wb->mail() encapsulates this, using PHPMailer driver.

String getError()

Allows to retrieve the last error stored by setError().

Used internally

init()

setError($msg)

Clone this wiki locally