如果我的域名为xxxxdomain.com,并且我有多个邮件,例如mail1 @ domain.com,mail2 @ domain.com等。现在,我需要检索域系统中的所有邮件收件箱内容。
<html><head></head>
<body>
<?php
$mbox = imap_open("{imap.example.org:143}", "username", "password");
echo "<h1>Mailboxes</h1>\n";
$folders = imap_listmailbox($mbox, "{imap.example.org:143}", "*");
if ($folders == false) {
echo "Call failed<br />\n";
} else {
foreach ($folders as $val) {
echo $val . "<br />\n";
}
}
echo "<h1>Headers in INBOX</h1>\n";
$headers = imap_headers($mbox);
if ($headers == false) {
echo "Call failed<br />\n";
} else {
foreach ($headers as $val) {
echo $val . "<br />\n";
}
}
imap_close($mbox);
?>