Forwarding or Replying to Email Messages Stored as Rich Text

This tutorial explains how to forward email messages that are stored as rich text.


  1. Use the CImEmailOperation::CreateForwardL() function or the CreateReplyL() function to forward or reply to an email.

    The newly created email will be stored in the same format as the original email. In this case, it is rich text format and the formatting information is preserved while forwarding or replying to the email.

  2. Use the CImEmailOperation::ProgressL() function to obtain the TMsvId parameter of the newly created email. This is returned through a TPckgC <TMsvId > descriptor.

  3. Use the TMsvId aMessageId parameter to create a CMsvEntry object.

  4. Use the CMsvEntry object to create a CImEmailMessage object.

  5. Use the CImEmailMessage::GetBodyTextL() function to get the body text of the message that is being replied to or forwarded. This will return a CRichText class.

  6. If you want to use the rich text format, complete the following step 1. If you want to store the body text in plain text format, complete the following steps from 2 to 4.

    1. Edit the CRichText class and call the CImEmailMessage::StoreBodyTextL() function to store the edited body text.

    2. Call the CImEmailMessage::OpenPlainBodyTextForWriteL() function to get CImPlainBody Text.

    3. Call the CImPlainBodyText::StoreRichTextAsPlainTexL() function and pass the edited CRichText class to store the message.

    4. Call the CImPlainBodyText::CommitL() function to complete the operation.