Issues

ZF2-487: Ambiguous smtp options for creating transport object.

Description

For sending mail we configure Smtp transport. But for transport is enough to get properly configured protocol object. It work:


        $transport = new SmtpTransport(new SmtpOptions(array(
            'name'             => 'gmail',
            'host'             => 'smtp.gmail.com',
            'port'             => 465,
            'connectionClass'  => 'login',
            'connectionConfig' => array(
                'ssl'      => 'ssl',
                'username' => 'user',
                'password' => 'pass',
            )
        )));
        $transport->send($message);

It don't work but should:


        $transport = new SmtpTransport(new SmtpOptions(array(
            'name'             => 'gmail',
            'connectionClass'  => 'login',
            'connectionConfig' => array(
                'ssl'      => 'ssl',
                'host'     => 'smtp.gmail.com',
                'port'     => 465,
                'username' => 'user',
                'password' => 'pass',
            )
        )));
        $transport->send($message);

Zend\Mail\Transport\Smtp:send() use only connection protocol. I guess class SmtpOptions is wasted. It's enough Protocols classes, or them should get configs from SmtpOptions class.

Comments

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2533