Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: aizul on April 07, 2015, 02:30:17 AM

Title: rcmail storage object structure difference
Post by: aizul on April 07, 2015, 02:30:17 AM
Hello everyone,

I used this to get the content of a message:

Code: [Select]
$rcmail->storage->icache['message']->structure->body;

The problem is if the message contains attachments, the structure is different and there is no body. I can't find the content of the message anywhere in the object of the message. Is there a better way to get the message content?

Thanks
Title: Re: rcmail storage object structure difference
Post by: alec on April 07, 2015, 03:27:59 AM
You should use rcube_message class.
Title: Re: rcmail storage object structure difference
Post by: aizul on April 07, 2015, 10:50:45 PM
Thanks alec.

I managed to solved my problem.

Code: [Select]

$rcmail = rcmail::get_instance();
$msg_uid = $rcmail->storage->msg_uid;

$message = new rcube_message($msg_uid);

// use $message->first_text_part();
// or $message->first_html_part();