slam / zend-mail-extensions
Slam extensions for zendframework/zend-mail
Fund package maintenance!
Slamdunk
paypal.me/filippotessarotto
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
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:
- https://github.com/zendframework/zend-mail/pull/27
- https://github.com/zendframework/zend-mail/pull/117
- 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);