Page 1 of 1

imap_open and POP3 mail server

Posted: Wed Jun 02, 2004 6:01 am
by pelegk2
i am working wiht a lotus notes email server that supports POP3 but not imap!
i did this :

Code: Select all

$mbox = imap_open("{localhost:110/pop3}INBOX","myUser","myPass")
      or die("can't connect: ".imap_last_error());

$list = imap_getmailboxes($mbox,"{localhost:110/pop3}INBOX","*");
print_r($list);
if(is_array($list)) {
  reset($list);
  while (list($key, $val) = each($list))
  {
    print "($key) ";
    print imap_utf7_decode($val->name).",";
    print "'".$val->delimiter."',";
    print $val->attributes."<br>\n";
  &#125;
&#125; else
  print "imap_getmailboxes failed: ".imap_last_error()."\n";

imap_close($mbox);
i succed on connecting and i see it in the server console
!

now i am trying to get the list of all mailboxes but all i get is this :
Array ( [0] => stdClass Object ( [name] => {localhost:110/pop3}INBOX [attributes] => 1 [delimiter] => ) ) (0) {localhost:110/pop3}INBOX,'',1
what can i do?
thanks in advance
PEleg

Posted: Wed Jun 02, 2004 11:48 am
by launchcode
$list will contain an array of objects - which it appears to have done correctly (stdClass Object). Basically the code you've got (from the PHP help file) has done exactly what you asked it to do.

Posted: Wed Jun 02, 2004 8:40 pm
by evanz
$list = imap_getmailboxes($mbox,"{localhost:110/pop3}INBOX","*");
if you want to get a list of mail boxes why do you still have "INBOX" there.
This means you refer to this box only (INBOX).

I'd remove this from the code.

Posted: Thu Jun 03, 2004 1:46 am
by pelegk2
i have removed the INBOX and go this :
Array ( [0] => stdClass Object ( [name] => {192.168.4.222:110/pop3}INBOX [attributes] => 1 [delimiter] => ) ) (0) {192.168.4.222:110/pop3}INBOX,'',1

ok launchcode

Posted: Thu Jun 03, 2004 1:48 am
by pelegk2
so what do i do know?
how do i extract from the class all the name and email?
can u help me with that/>
thnaks alot
peleg