Author Topic: rcmail storage object structure difference  (Read 4215 times)

Offline aizul

  • Newbie
  • *
  • Posts: 2
rcmail storage object structure difference
« 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

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: rcmail storage object structure difference
« Reply #1 on: April 07, 2015, 03:27:59 AM »
You should use rcube_message class.

Offline aizul

  • Newbie
  • *
  • Posts: 2
Re: rcmail storage object structure difference
« Reply #2 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();