Mail/Transport/Abstract.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: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Mail_Transport_Abstract
Abstract for sending eMails through different ways of transport
- Children
- \Zend_Mail_Transport_Sendmail
- \Zend_Mail_Transport_Smtp
- \Zend_Mail_Transport_File
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

string $EOL = "\r\n"EOL character string used by transport
"\r\n"Details- Type
- string
- Access
- public

array $_headers = array()Array of message headers
array()Details- Type
- array
- Access
- protected

boolean $_isMultipart = falseMessage is a multipart message
falseDetails- Type
- boolean
- Access
- protected

false|\Zend_Mail $_mail = falseZend_Mail object
falseDetails- Type
- false | \Zend_Mail
- Access
- protected

array $_parts = array()Array of message parts
array()Details- Type
- array
- Access
- protected
Methods

_buildBody() : voidGenerate MIME compliant message from the current configuration
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
| Name | Type | Description |
|---|---|---|
| $item | string | |
| $key | string | |
| $prefix | string |
- Access
- protected
- Static

_getHeaders(string $boundary) : arrayReturn all mail headers as an array
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 |

_prepareHeaders(mixed $headers) : voidPrepare header string for use in transport
Prepares and generates $header based on the headers provided.
| Name | Type | Description |
|---|---|---|
| $headers | mixed |
| Exception | Description |
|---|---|
| \Zend_Mail_Transport_Exception | if any header lines exceed 998 characters |
- Access
- protected

_sendMail() : voidSend an email independent from the used transport
The requisite information for the email will be found in the following properties:
- $recipients - list of recipients (string)
- $header - message header
- $body - message body

send(\Zend_Mail $mail) : voidSend a mail using this transport
| Name | Type | Description |
|---|---|---|
| \Zend_Mail |
| Exception | Description |
|---|---|
| \Zend_Mail_Transport_Exception | if mail is empty |
- Access
- public