# Class LoggerAppenderMail

LoggerAppenderMail appends log events via email.

This appender does not send individual emails for each logging requests but will collect them in a buffer and send them all in a single email once the appender is closed (i.e. when the script exists). Because of this, it may not appropriate for long running scripts, in which case LoggerAppenderMailEvent might be a better choice.

This appender uses a layout.

# Configurable parameters:

- to - Email address(es) to which the log will be sent. Multiple email addresses may be specified by separating them with a comma.
- from - Email address which will be used in the From field.
- subject - Subject of the email message.

  LoggerConfigurable
  LoggerAppender
  LoggerAppenderMail

Package: log4php\appenders
License: Apache License, Version 2.0
Version: $Revision: 1337820 $
Link: Appender documentation
Located at appenders/LoggerAppenderMail.php

Methods summary
`public` | # `append( `LoggerLoggingEvent` $event )` Forwards the logging event to the destination. Forwards the logging event to the destination. Derived appenders should implement this method to perform actual logging.

#### Parameters

$event
  ``LoggerLoggingEvent``
  $event

`public` | # `close( )` Releases any resources allocated by the appender. Releases any resources allocated by the appender. Derived appenders should override this method to perform proper closing procedures.

#### Overrides

`LoggerAppender::close()`
`public` | # `setSubject( mixed $subject )` Sets the 'subject' parameter. Sets the 'subject' parameter.
`public` | # `getSubject( )` Returns the 'subject' parameter. Returns the 'subject' parameter.
`public` | # `setTo( mixed $to )` Sets the 'to' parameter. Sets the 'to' parameter.
`public` | # `getTo( )` Returns the 'to' parameter. Returns the 'to' parameter.
`public` | # `setFrom( mixed $from )` Sets the 'from' parameter. Sets the 'from' parameter.
`public` | # `getFrom( )` Returns the 'from' parameter. Returns the 'from' parameter.
`public` | # `setDry( mixed $dry )` Enables or disables dry mode. Enables or disables dry mode.

Methods inherited from LoggerAppender
`__construct(), __destruct(), activateOptions(), addFilter(), clearFilters(), doAppend(), getDefaultLayout(), getFilter(), getFirstFilter(), getLayout(), getName(), getThreshold(), isAsSevereAsThreshold(), requiresLayout(), setLayout(), setName(), setThreshold(), warn()`

Methods inherited from LoggerConfigurable
`setBoolean(), setFileSize(), setInteger(), setLevel(), setNumeric(), setPositiveInteger(), setString()`

Properties summary
`protected string` | $from | `null` | # Email address to put in From field of the email. Email address to put in From field of the email.
`protected string` | $subject | `'Log4php Report'` | # The subject of the email. The subject of the email.
`protected string` | $to | `null` | # One or more comma separated email addresses to which to send the email. One or more comma separated email addresses to which to send the email.
`protected string` | $body | `''` | # Buffer which holds the email contents before it is sent. Buffer which holds the email contents before it is sent.

Properties inherited from LoggerAppender
`$closed, $filter, $layout, $name, $requiresLayout, $threshold`