Issues

ZF-4955: Have zend_mail support instantiation from an options array

Description

It would be great to have ability to configure Zend_Mail from config file similar to Zend_Db or Zend_Cache components Sample use case:

INI


[production]
mail.transport = smtp
mail.host = 127.0.0.1
mail.config.name = localhost
mail.config.auth.type = login
mail.config.auth.userame = somelogin
mail.config.auth.password = somepass

[development : production]
mail.transport = sendmail
mail.parameters = '-f someparameters'

PHP


$config = new Zend_Config_Ini('config.ini', 'production');
$mt = Zend_Mail::factory($config->mail);
Zend_Mail::setDefaultTransport($mt);

Comments

MEMO: parameter name could be took into account from ZF-8436.

Sorry, I have been inactive since last April.

Ramon, if you implement this; please do so by implementing a setOptions() method, which gets called if Zend_Mail::__construct()'s first argument is an array or instance of zend_config. If you're uncomfortable doing this or unsure how, please just reassign. I'll then do it (but maybe only with zf2).

Hi Dolf Thanks by your feedback. Sorry by delay in response ;). I want to do this improvement to 1.11.

Will be or has been implemented for ZF2