I want to use roundcube API to create a webapplication but i've some problem with the IMAP class.
I want to print in a web page information about a message (like date, subject, sender and body).
This is my code:
<?php
include("lib/bugs.inc");
include("lib/rcube_imap.php");
include("lib/rcube_shared.php");
include("lib/rcube_mdb2.php");
include("lib/rcube_main.php");
include("lib/rcube_message.php");
include("lib/rcmail.php");
include("lib/rcube_config.php");
// include("lib/mime.php");
// include("lib/rcube_mail_mime.php");
$DB = new rcube_mdb2("mysqli://USERNAME:PASSWORD@HOST/DB");
$imap = new rcube_imap($DB);
$imap->connect("IMAP.SERVER", "USERNAME", "PASSWORD", 993, "ssl");
echo "<br />" . $imap->get_mailbox_name();
echo "<br />";
foreach($imap->list_mailboxes() as $mailbox)
echo "<br />" . $mailbox . "(".$imap->messagecount($mailbox).")";
echo "<br /><br />";
foreach ($imap->list_headers('Trash') as $header) {
echo $header->date . " " . $header->uid. " " . $header->from . " " . $header->subject . " :: ";
$MESSAGE = new rcube_message($header->id, $imap);
if (!empty($MESSAGE->headers->charset))
// $imap->set_charset($MESSAGE->headers->charset);
$mbox_name = $IMAP->get_mailbox_name();
}
$imap->close();
?>
It works but i can print on page only date, subject and sender... i can't print the message body, can someone help me?
tnx