$mbox = imap_open( "{your.imap.host}" ,"username" ,"password",OP_HALFOPEN) or die("can't connect: ".imap_last_error()); $list = imap_getmailboxes($mbox ,"{your.imap.host}" ,"*"); 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";}} else print "imap_getmailboxes failed: ".imap_last_error() ."\n"; imap_close($mbox);
?php $mbox = imap_open( "{your.imap.host}" ,"utilisateur" ,"mot_de_passe",OP_HALFOPEN) or die("connexion impossible: ".imap_last_error()); $list = imap_getmailboxes($mbox ,"{your.imap.host}" ,"*"); 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";}} else print "imap_getmailboxes a échoué: ".imap_last_error() ."\n"; imap_close($mbox);?