Creating Email Messages in Plain Text Format

This tutorial explain the steps to create email messages in plain text format.

Procedure

  1. Create an email entry in the message store using the CImEmailOperation::CreateNewL() function, which takes all the following nine parameters:

    static IMPORT_C CImEmailOperation *CreateNewL(TRequestStatus &aObserverRequestStatus,
    CMsvSession &aMsvSession, TMsvId aDestination, TMsvId aSmtpServiceId,
    TMsvPartList aPartList, const TMsvEmailTypeList &aMsvEmailTypeList,
    TUid aMsgType, TInt aPriority, TBool aUsePlainTextStorage);
  2. Set the TBool parameter to ETrue.

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

  4. Create a CMsvEntry object using the TMsvId aMessageId parameter of the newly created email.

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

  6. Call the CImEmailMessage::OpenPlainBodyTextForWriteL() function to get a new instance of CImPlainBodyText.

  7. If there are more than one chunk, use the StoreChunkL() function repeatedly to store the body text in chunks.

  8. When the message body text is completely stored, call the CImPlainBodyText::CommitL() function to complete the email creation operation.

Related concepts