slam / zend-mail-extensions
此包已被 弃用 并不再维护。未建议替代包。
为 zendframework/zend-mail 提供的 Slam 扩展
v1.0.0
2018-03-16 14:31 UTC
Requires
- php: ^7.1
- zendframework/zend-mail: ^2.9
- zendframework/zend-servicemanager: ^3.3
Requires (Dev)
- phpstan/phpstan: ^0.9.1
- phpstan/phpstan-phpunit: ^0.9.3
- phpunit/phpunit: ^7.0
- slam/php-cs-fixer-extensions: ^1.13
- slam/php-debug-r: ^1.2
- slam/phpstan-extensions: ^1.0
- thecodingmachine/phpstan-strict-rules: ^0.9.0
This package is auto-updated.
Last update: 2020-12-04 12:15:43 UTC
README
为 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)。
参考
- https://github.com/zendframework/zend-mail/pull/27
- https://github.com/zendframework/zend-mail/pull/117
- 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);