However I need to set the 'from' address and this doesn't appear to be possible using TMsvEntry. The class CSmsHeader has a function SetFromAddressL that appears to do what I want but I can't find any documentation or example code on how it should be used.
 iSmsMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId); //inbox  //iSmsMtm->SwitchCurrentEntryL(KMsvDraftEntryId); //draft
 iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);  //iSmsMtm->AddAddresseeL(aAddress); //to address if need
 CSmsHeader& iHeader = iSmsMtm->SmsHeader();  iHeader.SetFromAddressL(aAddress);
 CRichText& body = iSmsMtm->Body();  body.Reset();  body.InsertL(0, aMessage);   TMsvEntry entry = iSmsMtm->Entry().Entry();  entry.SetInPreparation(EFalse);  entry.SetVisible(ETrue);  entry.iDate.HomeTime();  entry.iDescription.Set(aDescription);  entry.iDetails.Set(aAddress);  entry.SetUnread(ETrue);
 iSmsMtm->Entry().ChangeL(entry);  iSmsMtm->SaveMessageL();  }
arik, did you try to do that by yourself? Though the message is really created in Inbox it seems to be an outgoing one.
Yes I have tried it myself. I have used this only in testing, so only thing I want is that message born in inbox. You could be right, but you can put still from number.
Indeed, calling SetFromAddressL() won't cause any problem. But it won't show in message details as well
Yes you are right it won't show in the details and that's too bad. But in testing this works cause you can get from address when reading this message as well:
Forum posts: 31
void CpssSMSEngine::ConstructL()Â {
  iSession = CMsvSession::OpenAsyncL(*this);
}
void CpssSMSEngine::CreateSMSMessageL(const TDesC& aAddress, const TDesC& aDescription, const TDesC& aMessage) {
 iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
 iSmsMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL(KUidMsgTypeSMS));
 iSmsMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId); //inbox
 //iSmsMtm->SwitchCurrentEntryL(KMsvDraftEntryId); //draft
 iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);
 //iSmsMtm->AddAddresseeL(aAddress); //to address if need
 CSmsHeader& iHeader = iSmsMtm->SmsHeader();
 iHeader.SetFromAddressL(aAddress);
 CRichText& body = iSmsMtm->Body();
 body.Reset();
 body.InsertL(0, aMessage);
Â
 TMsvEntry entry = iSmsMtm->Entry().Entry();
 entry.SetInPreparation(EFalse);
 entry.SetVisible(ETrue);
 entry.iDate.HomeTime();
 entry.iDescription.Set(aDescription);
 entry.iDetails.Set(aAddress);
 entry.SetUnread(ETrue);
 iSmsMtm->Entry().ChangeL(entry);
 iSmsMtm->SaveMessageL(); Â
}
Regards
Ari
Forum posts: 20
Forum posts: 31
Yes I have tried it myself. I have used this only in testing, so only thing I want is that message born in inbox. You could be right, but you can put still from number.
Regards
Ari
Forum posts: 20
Forum posts: 31
Yes you are right it won't show in the details and that's too bad. But in testing this works cause you can get from address when reading this message as well:
CSmsClientMtm* tempSmsMtm = STATIC_CAST(CSmsClientMtm*, clientMtm);
CSmsHeader& header = tempSmsMtm->SmsHeader();
iSender.Copy(header.FromAddress());
Maybe CSendAs will do that kind of message where you can see from number in the details. I don't know I haven't try.
Regards
Ari