On 16 Jul 2008, at 12:36, Dermot Buckley wrote:
Hi All,
We're having a bit of a problem here with Zend_Mail when sending
mail with a pdf attachment (it works fine when there's no attachment).
I've done a bit more digging regarding the above, and I'm stumped :)
It's not related to the attachments as I originally thought, but
rather it seems to be something to do with the destruction of the
connection and its related classes.
Here's the sequence of events from what I can see:
The mail is sent, then
Zend_Mail_Protocol_Abstract::_destruct(), calls
Zend_Mail_Protocol_Abstract::_disconnect(), which closes the
connection to the smtp server (Zend_Mail_Protocol_Abstract::_socket)
Later,
Zend_Mail_Transport_Smtp::_destruct(), has the following code:
if ($this->_connection instanceof Zend_Mail_Protocol_Smtp) {
try {
$this->_connection->quit();
} catch (Zend_Mail_Protocol_Exception $e) {
// ignore
}
$this->_connection->disconnect();
}
which calls
Zend_Mail_Protocol_Smtp::quit()
which ultimately tries to send a smtp QUIT over the previously closed
socket.
This tries to raise the exception I posted (failing to load the
associated class).
As I said, I'm stumped!
Can anyone shed any light?