Mail/Transport/Sendmail.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Mail
- Subpackage
- Transport
- Version
- $Id: Sendmail.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Mail_Transport_Sendmail
Class for sending eMails via the PHP internal mail() function
- Parent(s)
- \Zend_Mail_Transport_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_headers = array()
array()Details- Type
- array
- Access
- protected
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$_headers

boolean $_isMultipart = falseMessage is a multipart message
Inherited from: \Zend_Mail_Transport_Abstract::$$_isMultipartfalseDetails- Type
- boolean
- Access
- protected
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$_isMultipart

false|\Zend_Mail $_mail = false
falseDetails- Type
- false | \Zend_Mail
- Access
- protected
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$_mail

array $_parts = array()
array()Details- Type
- array
- Access
- protected
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$_parts

string $body = ''
''Details- Type
- string
- Access
- public
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$body

string $boundary = ''
''Details- Type
- string
- Access
- public
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$boundary

string $header = ''
''Details- Type
- string
- Access
- public
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$header

string $recipients = ''
''Details- Type
- string
- Access
- public
- Inherited_from
- \Zend_Mail_Transport_Abstract::$$recipients
Methods

__construct(string | array | \Zend_Config $parameters = null) : voidConstructor.
| Name | Type | Description |
|---|---|---|
| $parameters | string | array | \Zend_Config | OPTIONAL (Default: null) |

_buildBody() : voidGenerate MIME compliant message from the current configuration
Inherited from: \Zend_Mail_Transport_Abstract::_buildBody()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.

_formatHeader(string $item, string $key, string $prefix) : voidPrepend header name to header value
Inherited from: \Zend_Mail_Transport_Abstract::_formatHeader()| Name | Type | Description |
|---|---|---|
| $item | string | |
| $key | string | |
| $prefix | string |
- Access
- protected
- Static

_getHeaders(string $boundary) : arrayReturn all mail headers as an array
Inherited from: \Zend_Mail_Transport_Abstract::_getHeaders()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 Zend_Mail object present.
| Name | Type | Description |
|---|---|---|
| $boundary | string |
| Type | Description |
|---|---|
| array |

_handleMailErrors(int $errno, string $errstr, string $errfile = null, string $errline = null, array $errcontext = null) : trueTemporary error handler for PHP native mail().
| Name | Type | Description |
|---|---|---|
| $errno | int | |
| $errstr | string | |
| $errfile | string | |
| $errline | string | |
| $errcontext | array |
| Type | Description |
|---|---|
| true |

_prepareHeaders(array $headers) : voidFormat and fix headers
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.
| Name | Type | Description |
|---|---|---|
| $headers | array |
| Exception | Description |
|---|---|
| \Zend_Mail_Transport_Exception |
- Access
- protected

_sendMail() : voidSend mail using PHP native mail()
The requisite information for the email will be found in the following properties:
- $recipients - list of recipients (string)
- $header - message header
- $body - message body
| Exception | Description |
|---|---|
| \Zend_Mail_Transport_Exception | if parameters is set but not a string |
| \Zend_Mail_Transport_Exception | on mail() failure |
- Access
- public

send(\Zend_Mail $mail) : void
| Name | Type | Description |
|---|---|---|
| \Zend_Mail |
| Exception | Description |
|---|---|
| \Zend_Mail_Transport_Exception | if mail is empty |
- Access
- public