views:

121

answers:

2

Hi guys I'm trying to connect to an imap mail server using zend frameworks Zend_Mail_Storage_Imap function. Its working with some accounts but with most accounts it just dies out. I'm connecting using:

$mail = new Zend_Mail_Storage_Imap(array('host' =>$current_dept->incoming_server,
'ssl' =>$current_dept->ssl,
'port'=>$current_dept->incoming_port,
'folder'=>$mbox_name,
'user' =>$current_dept->email,
'password' =>$current_dept->email_psd));

WIth some email accounts teh code doesn't go past this statement - and instead I'm prompted to 'download' the php file being run. Whats happening here - the mail server details are correct.

+1  A: 

Did you disable error reporting? Usually you should get a helpful message when something goes wrong.

Use

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
phpSettings.error_reporting = E_ALL|E_STRICT

and/or

phpSettings.log_errors = 1
phpSettings.error_log = "/tmp/php-error.log"   

in your configuration file (application.ini). Of course you can make this settings also in the php.ini.

By this an error should be displayed (or logged to /tmp/php-error.log) to help you with debugging.

Alex
Error reporting is enabled the problem is that I'm prompted to download the php file which is ridiculous - the script is a simple email listing script.
Ali
@Ali is it the *source* PHP file?
Pekka
It prompts the download of a file named the source filename but when I do download I get a blank file...I think its something wrong with my webserver
Ali
+1  A: 

If it offers you the PHP file for download (and you really receive the PHP code then when accepting the download), there is something wrong with your webserver configuration.

You must make sure that .php files are run properly.

Alex