slam/zend-mail-extensions

此包已被 弃用 并不再维护。未建议替代包。

为 zendframework/zend-mail 提供的 Slam 扩展

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

Zend\Mail 提供的扩展

安装

执行

composer require slam/zend-mail-extensions

用法

此包的主要功能是 Protocol\TimeKeeperSmtpProxy,它允许处理实现类似 Postfix 的 reuse_time_limit 的 SMTP 服务器(参考:http://www.postfix.org/postconf.5.html#smtp_connection_reuse_time_limit)。

参考

  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

示例

/**
 * 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);