Reading Email Messages Using the Plain Text API

This tutorial explains how to read email messages using the plain text API.

Introduction

You can download and store email messages using the CMsvPlainBodyText API, and read them using the CImPlainBodyText API.

Procedure

  1. Use the TMsvId aMessageId parameter of the downloaded email to create the CMsvEntry class.

  2. Use the CMsvEntry class to create the CImEmailMessage object.

  3. Call the CImEmailMessage::OpenPlainBodyTextForReadL() function to get the CMsvPlainBodyText instance, passing in the number of characters that will be populated for each read operation.

  4. Use the CImPlainBodyText::NextChunkL() function or the CImPlainBodyText::PreviousChunkL() function to retrieve the body text of the message.

    Note: The NextChunkL() function is used to get the data of the email message in chunks and in sequential order from the beginning of the body text to the end of it. PreviousChunkL() is used to get the chunk that is previously retrieved by the NextChunkL() function. The size of the chunk is specified in the call to the CImEmailMessage ::OpenPlainBodyTextForReadL() function.

    Email applications must check the length of the chunk populated. If the length is zero (0) it indicates that it has reached the last chunk of the previous read operation.

Related concepts