marantzsquare
New Member
- Messages
- 4
- Reaction score
- 0
- Points
- 0
two weeks ago everything was ok with imap_open(), I haven't change my code.. and
now it doesn't work, why?:dunno:
10X
now it doesn't work, why?:dunno:
10X
...
...
...
$mbox = @imap_open($SERVERMAIL, $USERMAIL, $PASSMAIL)
or die("can't connect: " . imap_last_error());
$status = imap_status($mbox, $SERVERMAIL, SA_ALL);
if ($status)
{
echo "Msg: " . $status->messages . "<br />\n";
echo "New: " . $status->unseen . "<br />\n";
}
else
{
echo "imap_status failed: " . imap_last_error() . "\n";
}
...
...
...
after i posted this, my code works just one time :nuts:
my code works perfectly on my local server, and it worked perfectly till i posted my comment..
the error was in the statement imap_open(....);Code:... ... ... $mbox = @imap_open($SERVERMAIL, $USERMAIL, $PASSMAIL) or die("can't connect: " . imap_last_error()); $status = imap_status($mbox, $SERVERMAIL, SA_ALL); if ($status) { echo "Msg: " . $status->messages . "<br />\n"; echo "New: " . $status->unseen . "<br />\n"; } else { echo "imap_status failed: " . imap_last_error() . "\n"; } ... ... ...
right now i'm trying to understand why.. and suddenly it come back to works :eek4:
<?php
$mbox = imap_open("{localhost}", $USERMAIL, $PASSMAIL, OP_HALFOPEN)
or die("Can't Connect: " . imap_last_error());
$status = imap_status($mbox, "{localhost}INBOX", SA_ALL);
if ($status) {
echo "Messages: " . $status->messages . "<br />\n";
echo "New Messages: " . $status->unseen . "<br />\n";
} else {
echo "imap_status failed: " . imap_last_error() . "\n";
}
imap_close($mbox);
?>
Very Very GOoD:lockd:
How does this help this person. It doesn't. Stop spamming and :gtfo2:
Can you try this for me?
Code:<?php $mbox = imap_open("{localhost}", $USERMAIL, $PASSMAIL, OP_HALFOPEN) or die("Can't Connect: " . imap_last_error()); $status = imap_status($mbox, "{localhost}INBOX", SA_ALL); if ($status) { echo "Messages: " . $status->messages . "<br />\n"; echo "New Messages: " . $status->unseen . "<br />\n"; } else { echo "imap_status failed: " . imap_last_error() . "\n"; } imap_close($mbox); ?>