Re: imap client

Thomas Jarosch <[email protected]> Tue, 9 Jul 2019 16:09:15 +0200
Newsgroups gmane.comp.horde.devel
Message-ID <[email protected]>
Hi Andrea,

You wrote on Tue, Jul 09, 2019 at 02:23:22PM +0200:
> kinda newbie here. I've installed imap client through pear, and I need to
> use it in my laravel project.
> Can somebody explain how to auto load it?

here's a code snippet I use in a small script:


define("HORDE_BASE", "/usr/share/pear/Horde");
require_once HORDE_BASE . "/Autoloader/Default.php";

..

$imap = new Horde_Imap_Client_Socket(array("username" => $username,
                                           "password" => $password,
                                           "hostspec" => COLLECTOR_HOST,
                                           "port" => COLLECTOR_PORT,
                                           "secure" => false));

// Determine IMAP delimiter
$namespaces = $imap->getNamespaces();
$last_namespace = array_pop($namespaces);
$imap_delimiter = $last_namespace['delimiter'];

// --- Get the list of folders ("mailboxes" in IMAP speak) in that user's account from the server --------------------
$folders = $imap->listMailboxes("*", Horde_Imap_Client::MBOX_ALL, array("flat" => true));




HTH,
Thomas
-- 
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]