\Monolog\HandlerNativeMailerHandler

NativeMailerHandler uses the mail() function to send the emails

Classes extending it should (in most cases) only implement write($record)

Summary

Methods
Properties
Constants
handleBatch()
handle()
__construct()
isHandling()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
addHeader()
addParameter()
getContentType()
getEncoding()
setContentType()
setEncoding()
No public properties found
No constants found
send()
write()
getHighestRecord()
processRecord()
getDefaultFormatter()
$level
$bubble
$formatter
$processors
$to
$subject
$headers
$parameters
$maxColumnWidth
$contentType
$encoding
N/A
No private methods found
No private properties found
N/A

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$to

$to : array

The email addresses to which the message will be sent

Type

array

$subject

$subject : string

The subject of the email

Type

string

$headers

$headers : array

Optional headers for the message

Type

array

$parameters

$parameters : array

Optional parameters for the message

Type

array

$maxColumnWidth

$maxColumnWidth : integer

The wordwrap length for the message

Type

integer

$contentType

$contentType : string

The Content-type for the message

Type

string

$encoding

$encoding : string

The encoding for the message

Type

string

Methods

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(string|array  $to, string  $subject, string  $from, integer  $level = \Monolog\Logger::ERROR, boolean  $bubble = true, integer  $maxColumnWidth = 70) 

Parameters

string|array $to

The receiver of the mail

string $subject

The subject of the mail

string $from

The sender of the mail

integer $level

The minimum logging level at which this handler will be triggered

boolean $bubble

Whether the messages that are handled can bubble up the stack or not

integer $maxColumnWidth

The maximum column width that the message lines will have

isHandling()

isHandling(array  $record) : Boolean

Checks whether the given record will be handled by this handler.

This is mostly done for performance reasons, to avoid calling processors for nothing.

Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.

Parameters

array $record

Partial log record containing only a level key

Returns

Boolean

close()

close() 

Closes the handler.

This will be called automatically when the object is destroyed

pushProcessor()

pushProcessor(callable  $callback) : self

Adds a processor in the stack.

Parameters

callable $callback

Returns

self

popProcessor()

popProcessor() : callable

Removes the processor on top of the stack and returns it.

Returns

callable

setLevel()

setLevel(integer|string  $level) : self

Sets minimum logging level at which this handler will be triggered.

Parameters

integer|string $level

Level or level name

Returns

self

getLevel()

getLevel() : integer

Gets minimum logging level at which this handler will be triggered.

Returns

integer

setBubble()

setBubble(Boolean  $bubble) : self

Sets the bubbling behavior.

Parameters

Boolean $bubble

true means that this handler allows bubbling. false means that bubbling is not permitted.

Returns

self

getBubble()

getBubble() : Boolean

Gets the bubbling behavior.

Returns

Boolean —

true means that this handler allows bubbling. false means that bubbling is not permitted.

__destruct()

__destruct() 

addHeader()

addHeader(string|array  $headers) : self

Add headers to the message

Parameters

string|array $headers

Custom added headers

Returns

self

addParameter()

addParameter(string|array  $parameters) : self

Add parameters to the message

Parameters

string|array $parameters

Custom added parameters

Returns

self

getContentType()

getContentType() : string

Returns

string —

$contentType

getEncoding()

getEncoding() : string

Returns

string —

$encoding

setContentType()

setContentType(string  $contentType) : self

Parameters

string $contentType

The content type of the email - Defaults to text/plain. Use text/html for HTML messages.

Returns

self

setEncoding()

setEncoding(string  $encoding) : self

Parameters

string $encoding

Returns

self

send()

send(string  $content, array  $records) 

Send a mail with the given content

Parameters

string $content

formatted email body to be sent

array $records

the array of log records that formed this content

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

getHighestRecord()

getHighestRecord(array  $records) 

Parameters

array $records

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array