Sending mail problem...

Login to reply to this topic.
Wed, 2006-02-08 06:43
Joined: 2005-02-03
Forum posts: 24
Hi Everyone

I've managed to send mail using this code (after using iSendAs to save a message in the outbox):

void SendL()
{
iClientMtm = &( iSendAs->ClientMtm() );

   // Establish connection with the registry
   iMtmUiRegistry  = CMtmUiRegistry::NewL( *iSession );

   iBaseMtmUi = iMtmUiRegistry->NewMtmUiL( *iClientMtm );

   //Create CMsvEntrySelection with a single entry of the message created.
   // Use iClientMtm
   TMsvId entryId = iClientMtm->Entry().EntryId();
   CMsvEntrySelection* selection = new( ELeave ) CMsvEntrySelection();
   CleanupStack::PushL( selection );
   selection->AppendL( entryId );

   // Set context to target service
   // The following reads, "the id of the target service in the index entry of the
   // client-side MTM"
   TMsvId serviceID = iClientMtm->Entry().Entry().iServiceId;
   iClientMtm->SwitchCurrentEntryL( serviceID );

   iOperation = iBaseMtmUi->CopyToL( *selection, iStatus );

   CleanupStack::PopAndDestroy( selection );

   // Set current state
   iPhase = ESendingMail;
}

However I don't know when the sending ends, and if call
SetActive(), and in RunL() I delete iOperation the sending stops. Any ideas?
  • Login to reply to this topic.