|
|
This document details the various options available to the
Zend\Mail\Transport\File mail transport.
Example #1 File Transport Usage
use Zend\Mail\Transport\File as FileTransport,
Zend\Mail\Transport\FileOptions;
// Setup SMTP transport using LOGIN authentication
$transport = new FileTransport();
$options = new FileOptions(array(
'path' => 'data/mail/',
'callback' => function (FileTransport $transport) {
return 'Message_' . microtime(true) . '_' . mt_rand() . '.txt';
},
));
$transport->setOptions($options);
The path under which mail files will be written.
A PHP callable to be invoked in order to generate a unique name for a message file. By default, the following is used:
function (Zend\Mail\FileTransport $transport) {
return 'ZendMail_' . time() . '_' . mt_rand() . '.tmp';
}
Zend\Mail\Transport\FileOptions extends
Zend\Stdlib\Options, and inherits all functionality from that
class; this includes ArrayAccess and property overloading.
Additionally, the following explicit setters and getters are provided.
Set the path under which mail files will be written.
Implements fluent interface.
Get the path under which mail files will be written.
Returns string
Set the callback used to generate unique filenames for messages.
Implements fluent interface.
Get the callback used to generate unique filenames for messages.
Returns PHP callable argument.
Initialize the object. Allows passing a PHP array or
Traversable object with which to populate the
instance.
Please see the Quick Start for examples.
|
|
Copyright © 2005-2011 Zend Technologies Inc (compiled by mikaelkael with ZFDocumentor - GIT c517eb0).

