Issues

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

Issue Type: Bug Created: 2012-08-22T08:37:55.000+0000 Last Updated: 2012-10-08T20:14:56.000+0000 Status: Closed Fix version(s): Reporter: Vitalii (duken) (duken) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Mail

Related issues: Attachments:

Description

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

<pre class="highlight">
        $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:

<pre class="highlight">
        $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

Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:56.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts