似乎无法使我的代码正常工作。它只是打印“数组”我想要检索电子邮件地址列表:
<?php
$mbox = imap_open("{******.com:143/notls}", "******@******.com", "******");
echo "<h1>Email Addresses</h1>\n";
$headers = imap_headers($mbox);
if ($headers == false) {
echo "Call failed<br />\n";
} else {
foreach ($headers as $val) {
preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $val, $matches);
echo $matches[2] . "<br />\n";
}
}
imap_close($mbox);
?>