Class for sending email via the PHP internal mail() function

 Methods

Constructor.

__construct(null | string | array | \Traversable $parameters) 

Parameters

$parameters

nullstringarray\Traversable

OPTIONAL (Default: null)

Temporary error handler for PHP native mail().

handleMailErrors(int $errno, string $errstr, string $errfile, string $errline, array $errcontext) : bool

Parameters

$errno

int

$errstr

string

$errfile

string

$errline

string

$errcontext

array

Returns

boolalways true

Send mail using PHP native mail()

mailHandler(string $to, string $subject, string $message, string $headers, $parameters) 

Parameters

$to

string

$subject

string

$message

string

$headers

string

$parameters

Exceptions

\Zend\Mail\Exception\RuntimeException

Send a message

send(\Zend\Mail\Message $message) : 

Parameters

Returns

Set callback to use for mail

setCallable(\Zend\Mail\Transport\callable $callable) : \Zend\Mail\Transport\Sendmail

Primarily for testing purposes, but could be used to curry arguments.

Parameters

$callable

\Zend\Mail\Transport\callable

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

Set sendmail parameters

setParameters(null | string | array | \Traversable $parameters) : \Zend\Mail\Transport\Sendmail

Used to populate the additional_parameters argument to mail()

Parameters

$parameters

nullstringarray\Traversable

Exceptions

\Zend\Mail\Exception\InvalidArgumentException

Returns

Is this a windows OS?

isWindowsOs() : bool

Returns

bool

Prepare the body string

prepareBody(\Zend\Mail\Message $message) : string

Parameters

Returns

string

Prepare the textual representation of headers

prepareHeaders(\Zend\Mail\Message $message) : string

Parameters

Returns

string

Prepare additional_parameters argument

prepareParameters(\Zend\Mail\Message $message) : string

Basically, overrides the MAIL FROM envelope with either the Sender or From address.

Parameters

Returns

string

Prepare recipients list

prepareRecipients(\Zend\Mail\Message $message) : string

Parameters

Exceptions

\Zend\Mail\Exception\RuntimeException

Returns

string

Prepare the subject line string

prepareSubject(\Zend\Mail\Message $message) : string

Parameters

Returns

string

 Properties

 

Callback to use when sending mail; typically, {@link mailHandler()}

$callable : \Zend\Mail\Transport\callable

 

error information

$errstr : string

 

$operatingSystem

$operatingSystem : string

 

Config options for sendmail parameters

$parameters : string