Hi
I want to return a CLEAN list of my folders but imap_list
reqiures three parameter the second of which goes in to my output. imap_list ( resource $imap_stream , string $ref , string $pattern )
.
Why is this??? Here is my code:
<?php
$mailbox = "mail.e17pumphouse.org.uk";
$username = "enquiries@e17pumphouse.org.uk";
$password = "password";
$encryption = "notls"; // or ImapClient::ENCRYPT_SSL or ImapClient::ENCRYPT_TLS or null
$mbox = imap_open("{".$mailbox."/".$encryption."}", $username, $password);
echo "<h1>Mailboxes</h1>\n";
$folders = imap_listmailbox($mbox, "{".$mailbox."/".$encryption."}", "*");
if ($folders == false) {
echo "Call failed<br />\n";
} else {
foreach ($folders as $val) {
echo $val . "<br />\n";
}
}
imap_close($mbox);
?>
This outputs:
{mail.e17pumphouse.org.uk/notls}Sent
{mail.e17pumphouse.org.uk/notls}Spam
{mail.e17pumphouse.org.uk/notls}Trash
{mail.e17pumphouse.org.uk/notls}Drafts
{mail.e17pumphouse.org.uk/notls}INBOX
It should be:
Sent
Spam
Trash
Drafts
INBOX
Thanks in advance.