class Mailer extends AbstractSingleton implements OptionableInterface

Constants

MM_CLASSNAME

MM_CLASSVERSION

BOUNDARY_OPENER

BOUNDARY_CLOSER

BOUNDARY_PREFIX

Properties

static $LINE_ENDING
static $ADDERSSES_SEPARATOR
static $HEADERS_SEPARATOR

Methods

setOptions(array $options)

Set an array of options

setOption(string $name, mixed $value)

Set the value of a specific option

array
getOptions()

Get the array of options

mixed
getOption(string $name, mixed $default = null)

Get the value of a specific option

mixed
getDefault(string $name)

Get the value of a specific option

addError(string $message)

Add error

mixed
getErrors(bool $echoable = false)

Get the errors

addInfo(string $message)

Add info

mixed
getInfos(bool $echoable = false)

Get the informations

void
setRegistry(string $var = null, mixed $val = null, string $section = false)

Set a registry entry

mixed
getRegistry(string $var = null, string $section = false, mixed $default = false)

Get a registry entry

addMessage(MessageInterface $message)

Build a new message

string
getMessage(int $id = null)

Get a message by id or current message

setTransporter(TransportInterface $transporter)

Set a transporter

string
getTransporter()

Get the transporter

setSpooler(SpoolInterface $spooler)

Set a spooler manager

string
getSpooler()

Get the spooler

setDryRun(bool $dry = true)

Make a dry run of the class : no mail will be sent

bool
getDryRun()

Get the dry run value

bool
isDryRun()

Is it dry run?

setSpool(bool $spool = true)

Activate emails spooling

bool
getSpool()

Get the spool value

bool
isSpool()

Is it spooling?

setSpoolDirectory(string $dir)

Set the spooled mails directory

string
getSpoolDirectory()

Get the spooled mails directory

bool|mixed
send(bool $return_info = false)

Messages sender

mixed
spool(bool $return_info = false)

Messages spooler : prepare the whole content and write it in a file

Details

at line 163
Mailer setOptions(array $options)

Set an array of options

Parameters

array $options

Return Value

Mailer

at line 176
Mailer setOption(string $name, mixed $value)

Set the value of a specific option

Parameters

string $name
mixed $value

Return Value

Mailer

at line 187
array getOptions()

Get the array of options

Return Value

array

at line 199
mixed getOption(string $name, mixed $default = null)

Get the value of a specific option

Parameters

string $name
mixed $default

Return Value

mixed

at line 210
mixed getDefault(string $name)

Get the value of a specific option

Parameters

string $name

Return Value

mixed

at line 264
Mailer addError(string $message)

Add error

Parameters

string $message

Return Value

Mailer

at line 277
mixed getErrors(bool $echoable = false)

Get the errors

Parameters

bool $echoable Do we have to return a string to echo ? (FALSE by default)

Return Value

mixed The errors stack as an array by default, a string to display if $echoable=true

at line 292
Mailer addInfo(string $message)

Add info

Parameters

string $message

Return Value

Mailer

at line 305
mixed getInfos(bool $echoable = false)

Get the informations

Parameters

bool $echoable Do we have to return a string to echo ? (FALSE by default)

Return Value

mixed The errors stack as an array by default, a string to display if $echoable=true

at line 326
void setRegistry(string $var = null, mixed $val = null, string $section = false)

Set a registry entry

Parameters

string $var The entry name
mixed $val The entry value
string $section A sub-section to search the entry

Return Value

void

at line 347
mixed getRegistry(string $var = null, string $section = false, mixed $default = false)

Get a registry entry

Parameters

string $var The entry name
string $section A sub-section to search the entry
mixed $default The value returned if nothing had been found

Return Value

mixed The value of the entry if found, $default otherwise

at line 369
Mailer addMessage(MessageInterface $message)

Build a new message

Parameters

MessageInterface $message

Return Value

Mailer

at line 384
string getMessage(int $id = null)

Get a message by id or current message

If no message exists for now, it will be created using the default messager class.

Parameters

int $id

Return Value

string

Exceptions

Exception if the default messager class doesn't exist

at line 410
Mailer setTransporter(TransportInterface $transporter)

Set a transporter

Parameters

TransportInterface $transporter

Return Value

Mailer

Exceptions

Exception if the default transporter::validate() does not return true

at line 430
string getTransporter()

Get the transporter

If no message exists for now, it will be created using the default transporter class.

Return Value

string

Exceptions

Exception if the default transporter class doesn't exist

at line 451
Mailer setSpooler(SpoolInterface $spooler)

Set a spooler manager

Parameters

SpoolInterface $spooler

Return Value

Mailer

at line 465
string getSpooler()

Get the spooler

If no message exists for now, it will be created using the default spooler class.

Return Value

string

Exceptions

Exception if the default spooler class doesn't exist

at line 486
Mailer setDryRun(bool $dry = true)

Make a dry run of the class : no mail will be sent

Parameters

bool $dry Activate dry run or not

Return Value

Mailer

at line 497
bool getDryRun()

Get the dry run value

Return Value

bool

at line 507
bool isDryRun()

Is it dry run?

Return Value

bool

at line 518
Mailer setSpool(bool $spool = true)

Activate emails spooling

Parameters

bool $spool Activate spool or not

Return Value

Mailer

at line 529
bool getSpool()

Get the spool value

Return Value

bool

at line 539
bool isSpool()

Is it spooling?

Return Value

bool

at line 550
Mailer setSpoolDirectory(string $dir)

Set the spooled mails directory

Parameters

string $dir The directory where to create spooled mails files

Return Value

Mailer

at line 561
string getSpoolDirectory()

Get the spooled mails directory

Return Value

string

at line 576
bool|mixed send(bool $return_info = false)

Messages sender

Parameters

bool $return_info Do we have to return an information about sending ?

Return Value

bool|mixed

at line 643
mixed spool(bool $return_info = false)

Messages spooler : prepare the whole content and write it in a file

Parameters

bool $return_info Do we have to return an information about sending ?

Return Value

mixed