[SOLVED] imap
Posted: Tue Dec 06, 2005 2:34 pm
Hi, I am trying to make a php script that opens an imap account and takes the e-mails and sends them to a database based on subject. Fort a support system none the less.
My Code So Far
The problem I am having is that the headers returns false. So I tried using imap_check. Which for some reason comes back with 0 messages and not in the folder INBOX like I selected. I know their are e-mails in the account I can check it on a client no problem. Any ideas would be great thanks!
My Code So Far
Code: Select all
$mbox = imap_open("{mail.phpccore.com}INBOX", "support@phpccore.com", "****", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
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";
}
}
$folders = imap_listmailbox($mbox, "{mail.phpccore.com}", "*");
if ($folders == false) {
echo "Call failed<br />\n";
} else {
foreach ($folders as $val) {
echo $val . "<br />\n";
}
}
imap_close($mbox);