I'v tried that piece of code on my exchange based imap and it failed; I then
tried it on my external, unix based, mail account and it worked perfectly,
after I used /pop3:110 after the server name, e.g.:
"{milu.ipn.pt/pop3:110}INBOX"...
Are you trying to use it with an MS Exchange Server?

Bye,
  Madruga

-----Original Message-----
From: Ben Cairns [mailto:[EMAIL PROTECTED]]
Sent: quinta-feira, 29 de Março de 2001 14:50
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] IMAP


I am trying to check the number of new messages in an IMAP mailbox, I ma
using 
this code but it doesn't seem to work, the username, password, host etc are 
correct, but still no cigar...any ideas?

Thanks

$mbox = imap_open("{your.imap.host}","username","password",OP_HALFOPEN)
      || die("can't connect: ".imap_last_error());
 
$status = imap_status($mbox,"{your.imap.host}INBOX",SA_ALL);
if($status) {
  print("Messages:   ". $status->messages   )."<br>\n";
  print("Recent:     ". $status->recent     )."<br>\n";
  print("Unseen:     ". $status->unseen     )."<br>\n";
  print("UIDnext:    ". $status->uidnext    )."<br>\n";
  print("UIDvalidity:". $status->uidvalidity)."<br>\n"; 
} else
  print "imap_status failed: ".imap_lasterror()."\n";
 
imap_close($mbox);


-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com

"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK......"


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to