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

category Zend
package Zend_Mail
subpackage Transport
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Mail_Transport_Abstract

 Methods

Constructor.

__construct(string|array|\Zend_Config $parameters = null) : void

Parameters

$parameters

stringarray\Zend_Config

OPTIONAL (Default: null)

Temporary error handler for PHP native mail().

_handleMailErrors(integer $errno, string $errstr, string $errfile = null, string $errline = null, array $errcontext = null) : true

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

string

$errcontext

array

Returns

true

Send mail using PHP native mail()

_sendMail() : void

The requisite information for the email will be found in the following properties:

  • \$recipients - list of recipients (string)
  • \$header - message header
  • \$body - message body
access public
inherited_from \Zend_Mail_Transport_Abstract::_sendMail()

Exceptions

\Zend_Mail_Transport_Exception if parameters is set but not a string
\Zend_Mail_Transport_Exception on mail() failure

Send a mail using this transport

send(\Zend_Mail $mail) : void
Inherited
access public

Parameters

$mail

\Zend_Mail

Exceptions

\Zend_Mail_Transport_Exception if mail is empty

Generate MIME compliant message from the current configuration

_buildBody() : void
Inherited

If both a text and HTML body are present, generates a multipart/alternative Zend_Mime_Part containing the headers and contents of each. Otherwise, uses whichever of the text or HTML parts present.

The content part is then prepended to the list of Zend_Mime_Parts for this message.

Prepend header name to header value

_formatHeader(string $item, string $key, string $prefix) : void
InheritedStatic
static
access protected

Parameters

$item

string

$key

string

$prefix

string

Return all mail headers as an array

_getHeaders(string $boundary) : array
Inherited

If a boundary is given, a multipart header is generated with a Content-Type of either multipart/alternative or multipart/mixed depending on the mail parts present in the \$_mail present.

Parameters

$boundary

string

Returns

array

Format and fix headers

_prepareHeaders(array $headers) : void

mail() uses its $to and $subject arguments to set the To: and Subject: headers, respectively. This method strips those out as a sanity check to prevent duplicate header entries.

access protected
inherited_from \Zend_Mail_Transport_Abstract::_prepareHeaders()

Parameters

$headers

array

Exceptions

\Zend_Mail_Transport_Exception

Prepare header string for use in transport

_prepareHeaders(mixed $headers) : void
Inherited

Prepares and generates \$header based on the headers provided.

access protected

Parameters

$headers

mixed

Exceptions

\Zend_Mail_Transport_Exception if any header lines exceed 998 characters

Send an email independent from the used transport

_sendMail() 
Inherited

The requisite information for the email will be found in the following properties:

  • \$recipients - list of recipients (string)
  • \$header - message header
  • \$body - message body

 Properties

 

EOL character string

$EOL : string

Default

PHP_EOL
access public
inherited_from \Zend_Mail_Transport_Abstract::EOL
 

EOL character string used by transport

$EOL : string

Default

"\r\n"
access public
 

Mail body

$body : string

Default

''
access public
 

MIME boundary

$boundary : string

Default

''
access public
 

Mail header string

$header : string

Default

''
access public
 

Config options for sendmail parameters

$parameters : string

Default

 

Recipients string

$recipients : string

Default

''
access public
 

Subject

$subject : string

Default

null
access public
 

error information

$_errstr : string

Default

 

Array of message headers

$_headers : array

Default

array()
access protected
 

Message is a multipart message

$_isMultipart : boolean

Default

false
access protected
 

Zend_Mail object

$_mail : false | \Zend_Mail

Default

false
access protected
 

Array of message parts

$_parts : array

Default

array()
access protected