File transport

Class for saving outgoing emails in filesystem

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(array|\Zend_Config $options = null) : void

Parameters

$options

array\Zend_Config

OPTIONAL (Default: null)

Default callback for generating filenames

defaultCallback($transport) : string

Parameters

$transport

Returns

string

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

Sets options

setOptions(array $options) : void

Parameters

$options

array

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

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

Saves e-mail message to a file

_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
inherited_from \Zend_Mail_Transport_Abstract::_sendMail()

Exceptions

\Zend_Mail_Transport_Exception on not writable target directory
\Zend_Mail_Transport_Exception on file_put_contents() failure

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

Recipients string

$recipients : string

Default

''
access public
 

Callback function generating a file name

$_callback : string | array

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
 

Target directory for saving sent email messages

$_path : string

Default