ZenMagick 0.9.10


org.zenmagick.core.services.misc\ZMMailer
core\services\misc\ZMMailer.php at line 58

Class ZMMailer

ZMObject
└─ZMMailer

public class ZMMailer
extends ZMObject

SwiftMailer Email service.

Thin wrapper for SwiftMailer, mostly to centralize initialization and such.

Due to the mostly generic function/method names it should be easy to replace this with some other library without causing too much trouble.

Supports the following transports (the transport is configured via the setting 'zenmagick.core.email.transport'):

smtp

Requires the following settings:

  • zenmagick.core.email.smtp.host
  • zenmagick.core.email.smtp.port
  • zenmagick.core.email.smtp.user (optional)
  • zenmagick.core.email.smtp.password (optional)
PHP

Use PHP's mail interface.

sendmail

Use sendmail. The default sendmail path (and parameters) is /usr/sbin/sendmail -bs. If this needs to be changed you may set 'zenmagick.core.email.sendmail' to whatever the path is.

Author:
DerManoMann

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

mixed

getMailer(mixed transport)

Get a mailer instance.

mixed

getMessage(string subject, string body, string contentType, string charset)

Get message.

mixed

getTransport()

Get a transport.

static void

instance()

Get instance.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

core\services\misc\ZMMailer.php at line 63

__construct

public void __construct()

Create new instance.


core\services\misc\ZMMailer.php at line 115

getMailer

public mixed getMailer(mixed transport)

Get a mailer instance.

Parameters:
transport - Optional transport; default is null to use the default transport.
Returns:
A mailer.

core\services\misc\ZMMailer.php at line 133

getMessage

public mixed getMessage(string subject, string body, string contentType, string charset)

Get message.

Parameters:
subject - Optional subject; default is an empty string.
body - Optional body text; default is an empty string.
contentType - Optional content type; default is null.
charset - Optional character set; default is utf-8>
Returns:
A message obect.

core\services\misc\ZMMailer.php at line 88

getTransport

public mixed getTransport()

Get a transport.

Returns:
The transport.

core\services\misc\ZMMailer.php at line 78

instance

public static void instance()

Get instance.


ZenMagick 0.9.10