Hi,
I'm trying to write a PHP mail parsing code for accessing and retrieving messages from an inbox using a series of IMAP based functions.I'm getting an error in a basic PHP code which I've written using just the imap_open() function and not any other functions as of now.When I try to connect using the code I get the following error
Array ( [0] => [CLOSED] IMAP connection broken (server response) )
This is the actual code which I'm using:
<?php
$server = "mail.ttu.edu";
$user = "";
$pass = "";
//fscokopen test
echo "<br> --> imap php test...<br>";
$i = @fsockopen($server, 993, $errno, $errstr, 30);
if ($i){
echo "<br> -->fsockopen test...<br>";
}
else {
echo $errno;
echo $errstr;
}
$i = @imap_open("{mail.ttu.edu:993}INBOX", $user, $pass);
if ($i){
echo "<br> --> connection successful....<br>";
}
else {
echo "<br> --> connection to server failed...<br>";
print_r(imap_errors());
}
?>
The error message which I'm getting is displayed exactly after 60 seconds from running the code.I'm not sure if it is from the server side or from the settings in my php.ini file.
Also note that fsockopen() is working fine and also telnet to port 993 of the server is working too.
It is kind of urgent so any help will be greately appreciated.
If you need any more inputs then please let me know.