ZF2-15: Ignore, fixed in 2.0.0dev2 Zend/Mail/AbstractProtocol.php fails to load Zend/Validator/Hostname.php


Creating a new smtp transport with

new \Zend\Mail\Transport\Smtp('hostname', $config)

results in an error: Warning: include_once(Zend\Validator\Hostname\Hostname.php) [function.include-once]: failed to open stream...

The reason is that Hostname.php is located in Zend\Validator and not in Zend\Validator\Hostname. I solved the issue by hacking Zend\Mail\AbstractProtocol.php constructor:

$this->_validHost->addValidator(new HostnameValidator\Hostname(HostnameValidator\Hostname::ALLOW_ALL));
$this->_validHost->addValidator(new Validator\Hostname(Validator\Hostname::ALLOW_ALL));


Hi, ivan. Thank you for report. Which version(commit) were you try? HEAD (git's latest) 's code is written as bellow. https://github.com/zendframework/zf2/…

I was using 2.0.0dev1, the bug is solved in 2.0.0dev2. Sorry for wasting your time by reporting a bug in old version.

closed by above reason