Hi, anybody knows how i can send SMS in the background without the editor?
Passing the TBool aLaunchEditorEmbedded as ETrue/False into CSendUi::CreateAndSendMessageL() dosent seem to make a difference
Thanks!
Hi, anybody knows how i can send SMS in the background without the editor?
Passing the TBool aLaunchEditorEmbedded as ETrue/False into CSendUi::CreateAndSendMessageL() dosent seem to make a difference
Thanks!
You should be able to send SMS in the background with SendAs API that is provided by RSendAs and RSendAsMessage classes.
Sending a message is done using e.g. RSendAsMessage::SendMessageAndCloseL(). The caller must hold sufficient capabilities to perform this action.
ic, thanks for the help! :)
hmm..i've looked at the RSendAsMessage class but not quite sure how to begin. I know i've got to first start a RSendAs session first..but from then onwards??? Couldnt find any examples or thread on any forum either besides this one either. Anybody got any ideas/clues/hints/code(:)) to share?
Thanks!
Last edited by jamespoh; 2006-02-02 at 07:46.
Hello,
Hope this helps. I just wrote it and seems to work.
RSendAs sendAs;
User::LeaveIfError(sendAs.Connect());
CleanupClosePushL(sendAs);
RSendAsMessage sendAsMessage;
sendAsMessage.CreateL(sendAs, KUidMsgTypeSMS);
CleanupClosePushL(sendAsMessage);
// prepare the message
sendAsMessage.AddRecipientL(aRecipient, RSendAsMessage::ESendAsRecipientTo);
sendAsMessage.SetBodyTextL(aMessageBody);
// send the message
sendAsMessage.SendMessageAndCloseL();
// sendAsMessage (already closed)
CleanupStack::Pop();
// sendAs
CleanupStack::PopAndDestroy();
Hello,
Does anybody have some code for getting notified when an incomming SMS comes?
Thank you!
Yes. You can create a CMsvSession, and the supplied observer will get notifications (EMsvEntriesCreated and EMsvEntriesChanged events occuring in the Inbox with messages of SmsMtm usually mean that an SMS has just arrived). Check other SMS-related threads for further information and examples.Originally Posted by mantonenco
I made in that way that I have a strange problem: I do not get the notification always.
I do not understand why.
I found the problem. Thanks wizard_hu_. The problem was that I was expecting only the EMsvEntriesCreated event on Inbox. Note for other people that run into the same problem: also EMsvEntriesChanged events occuring on Inbox may mean that an SMS has just arrived.
hi,
the code works fine to send sms..but the issue i face is that it asks the user for confirmation b4 sendin the sms...i believe that there is some security issue...can somone please clarify on that..
basically i want to send sms/email through my code without asking the user for anything...everything should happen in te background...
for email i change the mtm uid to the smtp type..but it crashes at that line....wonder why though
cheers
mayank
Yes, this is a security issue. If your code has the platform security capabilities for sending the SMS, the user is not asked for confirmation.