Hello.
In short, what's wrong with this code:
<?php
$server="pop.iskon.hr:110";
$user="alf";
$pass="********";
$conn=@imap_open("\{$server/imap}INBOX",$user,$pass) or die("Connection to server failed ".imap_last_error());
$headers=@imap_headers($conn) or die("Couldn't get emails"
;
$numEmails=sizeof($headers);
echo "You have $numEmails in your mailbox";
for ($i=1;$i<$numEmails+1;$i++)
{
$mailHeader=@imap_headerinfo($conn,$i);
$from=$mailHeader->fromaddress;
$subject=strip_tags($mailHeader->subject);
$date=$mailHeader->date;
echo "Email from $from, subject $subject, date $date<br>";
}
imap_close($conn);
?>
The problem is that this code doesn't retrive anything (including no error messages). Somehow it seems that connection is ok, but then nothing happens.
Another problem is that it tooks almost minute-two to finish output of this code (returning blank page).
Is this IMAP function slow anyhow? Or the problem might be that I opened an free email account with this
Their mail server (incoming) is pop.iskon.hr and port is 110. What could cause this problem? I see on some forums that guys (girls) do expirience simmilaire stuff, but none of solutions does work for me.
Thanks for any suggestions.
In short, what's wrong with this code:
<?php
$server="pop.iskon.hr:110";
$user="alf";
$pass="********";
$conn=@imap_open("\{$server/imap}INBOX",$user,$pass) or die("Connection to server failed ".imap_last_error());
$headers=@imap_headers($conn) or die("Couldn't get emails"

$numEmails=sizeof($headers);
echo "You have $numEmails in your mailbox";
for ($i=1;$i<$numEmails+1;$i++)
{
$mailHeader=@imap_headerinfo($conn,$i);
$from=$mailHeader->fromaddress;
$subject=strip_tags($mailHeader->subject);
$date=$mailHeader->date;
echo "Email from $from, subject $subject, date $date<br>";
}
imap_close($conn);
?>
The problem is that this code doesn't retrive anything (including no error messages). Somehow it seems that connection is ok, but then nothing happens.
Another problem is that it tooks almost minute-two to finish output of this code (returning blank page).
Is this IMAP function slow anyhow? Or the problem might be that I opened an free email account with this
Their mail server (incoming) is pop.iskon.hr and port is 110. What could cause this problem? I see on some forums that guys (girls) do expirience simmilaire stuff, but none of solutions does work for me.
Thanks for any suggestions.