Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Mail Laravel Package

zendframework/zend-mail

Zend\Mail provides robust email composition and transport for PHP applications, supporting MIME messages, attachments, multipart content, headers, encodings, and SMTP/sendmail/file transports. Includes message parsing and validation for reliable mail handling.

View on GitHub
Deep Wiki
Context7

File Transport Options

This document details the various options available to the Zend\Mail\Transport\File mail transport.

Quick Start

use Zend\Mail\Transport\File as FileTransport;
use Zend\Mail\Transport\FileOptions;

// Setup File transport
$transport = new FileTransport();
$options   = new FileOptions([
    'path'     => 'data/mail/',
    'callback' => function (FileTransport $transport) {
        return 'Message_' . microtime(true) . '_' . mt_rand() . '.txt';
    },
]);
$transport->setOptions($options);

Configuration Options

Option name Description
path The path under which mail files will be written.
callback A PHP callable to be invoked in order to generate a unique name for a message file. See below for the default used.

The default callback used is:

function (Zend\Mail\FileTransport $transport) {
    return 'ZendMail_' . time() . '_' . mt_rand() . '.tmp';
}

Available Methods

Zend\Mail\Transport\FileOptions extends Zend\Stdlib\AbstractOptions, and inherits all functionality from that class; this includes property overloading. Additionally, the following explicit setters and getters are provided.

setPath

setPath(string $path) : void

Set the path under which mail files will be written.

getPath

getPath() : string

Get the path under which mail files will be written.

setCallback

setCallback(callable $callback) : void

Set the callback used to generate unique filenames for messages.

getCallback

getCallback() : callable

Get the callback used to generate unique filenames for messages.

__construct

__construct(null|array|Traversable $config) : void

Initialize the object. Allows passing a PHP array or Traversable object with which to populate the instance.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4