ZF-7728: File "Zend/Validate/Hostname/Com.php" does not exist or class "Zend_Validate_Hostname_Com" was not found in the file


When I create a new instance of Zend_Mail_Transport_Smtp() with the first parameter a .com domain I got these error ;

File "Zend/Validate/Hostname/Com.php" does not exist or class "Zend_Validate_Hostname_Com" was not found in the file

here is my code

$t = new \Zend_Mail_Transport_Smtp('');

$mail = new \Zend_Mail(); ... $mail->send($t);


When you are getting this error than you don't use ZF 1.9.x. Check your installation. This file is provided and available since ZF 1.8.x

I am using the 1.9.2 version. The file Zend/Validate/Hostname/Com.php is available but there are no Class, only a return array();

Of course is there only an array and no class.

Looking into Zend_Validate_Hostname around line 417 you will see that the file is included by calling include 'Zend/Validate/Hostname/Com.php'. This way the regex from this file is assigned to be searched through. It's no class file but a ressource file.

As the file can not be found in your system it seems that you have eighter a configuration problem or no access to the related directory or you've mixed several versions of Zend Framework.

I close this issue since no further feedback is given and after a review i think the code must work as thomas described it.