ZF-6334: Zend_Mail_Transport_Smtp constructor leaves $_name property same


When I try Example 33.4. Sending Multiple Mails per SMTP Connection from… first of all I get a warning message "{{inet_pton(): Unrecognized address localhost}}" and if I change the {{$host}} parameter of constructor to different IP ADDRESS NOT HOSTNAME, the warning message continues to emerge.

Also as I noticed in code of {{Zend_Mail_Transport_Smtp->_sendMail}} method it tries to execute next line {{$this->_connection->helo($this->_name);}}. Is it proper line or it should be like this {{$this->_connection->helo($this->_host);}}}?

P.S. I think for loops in examples 33.4 and 33.5 have mistakes {{for ($i = 0; $i > 5; $i++) {}} it will never do any iteration because of condition {{$i > 5}}. It should be {{$i < 5}}


That's TRUE. What is the "_name" property used for?

Apparently, only for that call. It's set in the construct method from $config['name'] value (if set). By default, its value is "localhost".

Does it make sense to duplicate the 'host' value? Or are we missing something about "helo" method?


Hi, Marcos.

The $_name is used for sender hostname. It is different from $_host which means receiver's one.

I think the document seems to be bit difficult to understand how to use helo() function.

So, I will update the document.

Solved in SVN r18755 of trunk, r18756 of 1.9 branch.