Hi guys, I'm working with zend framework and recently had terrible issue swith my code. Actually I'm developing a webfront for emails and users enter their mail server details and are able to check on their email via my system.
The issue is that whenever I would try to connect to a mailserver my system just dies out sometimes and instead I am prompted to download the index page i.e the page being run - of course I'd end up with an empty page but thats not supposed to be happening.
I did some checking and found that the code is dying in the Zend_Mail_Protocol_Imap class in the connect function and that too at the code which says:
$this->_socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
on line 94 in the link posted.
What do I do here how do I set up a check to work around this atleast find out whats happened here :(
You can check out from a screenshot what I'm seeng here:
EDIT==================
My code which I'm actually running [I'm just using the libraries here] is :
$mailConfig = array('host' => $current_dept->incoming_server,
'port'=>$current_dept->incoming_port, 'folder'=>$mbox_name,
'user' =>$current_dept->email,
'password' =>$current_dept->email_psd);
$mailConfig['ssl'] ='ssl';
try{
if($mail)
unset($mail);
$mail = new Zend_Mail_Storage_Imap($mailConfig);
}catch (Zend_Mail_Exception $e) {
var_dump($e);
exit;
}
The fsockopen is in the Zend_mail_protocol_Imap class which is subsequently invoked within the constructor of the zend_mail_storage_imap class.
despite being enclosed in a try catch block its not even running the try catch block.
Plus the file prompted for download is just an empty file with the same name as the php file being executed.
EDIT ==========================
I've found the problem - for some reason an exception is being thrown and its nested really deep. But what I don't understand is this behavior of prompting to download a file instead of outputting any form of error message or so.