API Documentation

Mail/Transport/File.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 license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  
subpackage
Transport  
version
$Id$  

\Zend_Mail_Transport_File

File transport

Class for saving outgoing emails in filesystem

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

Properties

Propertyprotectedstring|array  $_callback= ''

Callback function generating a file name

Details
Type
stringarray
Propertyprotectedstring  $_path= ''

Target directory for saving sent email messages

Details
Type
string

Methods

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

Constructor

Parameters
Name Type Description
$options array|\Zend_Config

OPTIONAL (Default: null)

methodprotected_buildBody( ) : void

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
static

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

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 {@link $_mail Zend_Mail object} present.

Parameters
Name Type Description
$boundary string
Returns
Type Description
array
methodprotected_prepareHeaders( mixed $headers ) : void

Prepare header string for use in transport

Inherited from: \Zend_Mail_Transport_Abstract::_prepareHeaders()

Prepares and generates {@link $header} based on the headers provided.

Parameters
Name Type Description
$headers mixed
Throws
Exception Description
\Zend_Mail_Transport_Exception if any header lines exceed 998 characters
Details
access
protected  
methodprotected_sendMail( ) : void

Saves e-mail message to a file

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

  • {@link $recipients} - list of recipients (string)
  • {@link $header} - message header
  • {@link $body} - message body
Throws
Exception Description
\Zend_Mail_Transport_Exception on not writable target directory
\Zend_Mail_Transport_Exception on file_put_contents() failure
methodpublicdefaultCallback( \Zend_Mail_Transport_File $transport ) : string

Default callback for generating filenames

Parameters
Name Type Description
$transport \Zend_Mail_Transport_File File transport instance
Returns
Type Description
string
methodpublicsend( \Zend_Mail $mail ) : void

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  
methodpublicsetOptions( array $options ) : void

Sets options

Parameters
Name Type Description
$options array
Documentation was generated by DocBlox 0.13.3.