imap_open and POP3 mail server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

imap_open and POP3 mail server

Post 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
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post 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.
evanz
Forum Newbie
Posts: 6
Joined: Wed May 19, 2004 8:44 am

Post 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.
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post 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
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

ok launchcode

Post 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
Post Reply