Mail/Transport/Sendmail.php

Show: inherited
Table of Contents

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

Package: Zend\Mail\Transport

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

Propertypublicstring $EOL = PHP_EOL

EOL character string

Default valuePHP_EOLDetails
Type
string
Access
public  
Propertyprotectedstring $_errstr =

error information

Details
Type
string
Propertyprotectedarray $_headers = array()
inherited

Array of message headers

Inherited from: \Zend_Mail_Transport_Abstract::$$_headers
Default valuearray()Details
Type
array
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_headers  
Propertyprotectedboolean $_isMultipart = false
inherited

Message is a multipart message

Inherited from: \Zend_Mail_Transport_Abstract::$$_isMultipart
Default valuefalseDetails
Type
boolean
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_isMultipart  
Propertyprotectedfalse|\Zend_Mail $_mail = false
inherited

Zend_Mail object

Inherited from: \Zend_Mail_Transport_Abstract::$$_mail
Default valuefalseDetails
Type
false | \Zend_Mail
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_mail  
Propertyprotectedarray $_parts = array()
inherited

Array of message parts

Inherited from: \Zend_Mail_Transport_Abstract::$$_parts
Default valuearray()Details
Type
array
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_parts  
Propertypublicstring $body = ''
inherited

Mail body

Inherited from: \Zend_Mail_Transport_Abstract::$$body
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$body  
Propertypublicstring $boundary = ''
inherited

MIME boundary

Inherited from: \Zend_Mail_Transport_Abstract::$$boundary
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$boundary  
Propertypublicstring $header = ''
inherited

Mail header string

Inherited from: \Zend_Mail_Transport_Abstract::$$header
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$header  
Propertypublicstring $parameters =

Config options for sendmail parameters

Details
Type
string
Propertypublicstring $recipients = ''
inherited

Recipients string

Inherited from: \Zend_Mail_Transport_Abstract::$$recipients
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$recipients  
Propertypublicstring $subject = null

Subject

Default valuenullDetails
Type
string
Access
public  

Methods

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

Constructor.

Parameters
Name Type Description
$parameters string | array | \Zend_Config

OPTIONAL (Default: null)

methodprotected_buildBody() : void
inherited

Generate 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.

methodprotected_formatHeader(string $item, string $key, string $prefix) : void
staticinherited

Prepend header name to header value

Inherited from: \Zend_Mail_Transport_Abstract::_formatHeader()
Parameters
Name Type Description
$item string
$key string
$prefix string
Details
Access
protected  
Static
 
methodprotected_getHeaders(string $boundary) : array
inherited

Return 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.

Parameters
Name Type Description
$boundary string
Returns
Type Description
array
methodpublic_handleMailErrors(int $errno, string $errstr, string $errfile = null, string $errline = null, array $errcontext = null) : true

Temporary error handler for PHP native mail().

Parameters
Name Type Description
$errno int
$errstr string
$errfile string
$errline string
$errcontext array
Returns
Type Description
true
methodprotected_prepareHeaders(array $headers) : void

Format 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.

Parameters
Name Type Description
$headers array
Throws
Exception Description
\Zend_Mail_Transport_Exception
Details
Access
protected  
methodpublic_sendMail() : void

Send mail using PHP native mail()

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

Throws
Exception Description
\Zend_Mail_Transport_Exception if parameters is set but not a string
\Zend_Mail_Transport_Exception on mail() failure
Details
Access
public  
methodpublicsend(\Zend_Mail $mail) : void
inherited

Send a mail using this transport

Inherited from: \Zend_Mail_Transport_Abstract::send()
Parameters
Name Type Description
$mail \Zend_Mail
Throws
Exception Description
\Zend_Mail_Transport_Exception if mail is empty
Details
Access
public  
Documentation was generated by phpDocumentor 2.0.0a8.