zendframework / zend-mail

Mail component from Zend Framework
BSD 3-Clause "New" or "Revised" License
96 stars 111 forks source link

Transport service factory #120

Open autowp opened 7 years ago

autowp commented 7 years ago

There is missing service factory for mail transports like same in db and other components.

production config/autoload/local.php

return [
    'mail' => [
        'transport' => [
            'type'    => 'smtp',
            'options' => [
                'host'              => 'smtp.example.com',
                'connection_class'  => 'login',
                'connection_config' => [
                    'username' => 'no-reply@example.com',
                    'password' => 'xxxxxxxx',
                    'ssl'      => 'tls'
                ],
            ],
        ],
    ],
];

testing / dev config/autoload/local.php

return [
    'mail' => [
        'transport' => [
            'type'    => 'in-memory'
        ],
    ],
];

That is may look like https://github.com/autowp/zf-components/blob/master/src/Mail/Transport/TransportServiceFactory.php

fuel-wlightning commented 5 years ago

This appears to be at least somewhat implemented in: https://github.com/zendframework/zend-mail/blob/master/src/Transport/Factory.php

michalbundyra commented 4 years ago

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at https://github.com/laminas/laminas-mail/issues/47.