函式:imap_listmailbox()


imap_listmailbox

获取邮箱列示。

语法: array imap_listmailbox(int stream_id, string ref, string pattern);

传回值: 阵列

函式种类: 网路系统

内容说明

本函式可获得邮箱列示。参数 imap_stream 为 IMAP 的代号。参数 ref 通常为 IMAP 伺服器名称,参考下例。参数 pattern 可用万用字元 * 代表全部的路径,aayawa@yahoo.com 并指出 (27-Apr-1999) 若本参数以 "" (空字元) 代入,不会传回资料。

使用范例

本例为 alank@shermanloan.com 于 02-Jun-1999 所提出的。

<?php
$Account 
"myid";
$Password"mypasswd";
$mailbox imap_open("{mail.xyz.com:143}INBOX"$Account$Password);
if (
$mailbox) {
  
$mailboxes imap_listmailbox($mailbox"{mail.xyz.com:143}""*");
  for (
$index 0$index count($mailboxes); $index++) {
    print(
$mailboxes[$index] . "\n");
  }
  
imap_close($mailbox);
} else {
  print(
"无法?/font>}启 $Account 的信箱.\n");
}
?>


[ 上一页 下一页 ]