slam/zend-mail-extensions

This package is abandoned and no longer maintained. No replacement package was suggested.

Slam extensions for zendframework/zend-mail

v1.0.0 2018-03-16 14:31 UTC

This package is auto-updated.

Last update: 2020-12-04 12:15:43 UTC


README

Build Status Code Coverage Packagist

Extensions for Zend\Mail

Installation

Execute:

composer require slam/zend-mail-extensions

Usage

The main functionality of this package is the Protocol\TimeKeeperSmtpProxy, which allows to handle SMTP server that implements a reuse_time_limit like Postfix (ref: http://www.postfix.org/postconf.5.html#smtp_connection_reuse_time_limit).

References:

  1. https://github.com/zendframework/zend-mail/pull/27
  2. https://github.com/zendframework/zend-mail/pull/117
  3. https://github.com/zendframework/zend-mail/pull/131

Example:

/**
 * QUIT instruction is disabled by default
 * @see https://github.com/zendframework/zend-mail/pull/117
 *
 * All the Zend defaults options are still available
 * @see https://docs.zendframework.com/zend-mail/transport/smtp-authentication/
 */
$transport = new \Slam\Zend\Mail\Transport\Smtp();

$message = new \Zend\Mail\Message();
$message->setFrom('test@test.com');
$message->addTo('test@test.com');
$message->setSubject('Test');
$message->setBody('Test');

$transport->send($message);

sleep(305);

// $transport will automatically reconnect to the SMTP server
$transport->send($message);