The RSendAsMessage has been introduced in Symbian v9 and greatly simplifies the sending of a short messages (SMS) in C++.
// Link against sendas2.lib
#include <rsendas.h>
#include <rsendasmessage.h>
#include <senduiconsts.h>
...
// Open a connection with the SendAs server
RSendAs saSrv;
saSrv.Connect();
CleanupClosePushL(saSrv);
// Create your message
RSendAsMessage msg;
msg.CreateL(saSrv, KSenduiMtmSmsUid);
CleanupClosePushL(msg);
msg.AddRecipientL(aRecipientNumber,RSendAsMessage::ESendAsRecipientTo);
msg.SetBodyTextL(aMessageText);
// Send the message
msg.SendMessageAndCloseL();
// Cleanup
CleanupStack::Pop(&msg);
CleanupStack::PopAndDestroy(&saSrv);
Hi Nil
Yoy can use the CSendAsMessageTypes to query about available messagetypes and also find the human readable form of the message types. See the Symbian docs e.g http://www.symbian.com/developer/techlib/v9.1docs/doc_source/reference/reference-cpp/N1026A/CSendAsMessageTypesClass.html#%3a%3aCSendAsMessageTypes I Guess you can also have a look at where the constant KSenduiMtmSmsUid is defined and look for the mail equivalent.
Also, there is a minor fault in the example. The local RSendAsMessage variable is sometimes called message and sometimes message. But I guess you got that one.
/Anders
How and where do you define KSenduiMtmSmsUid?
Thanks
Thanks Eric,
Using this article, now i able to send SMS.
Now i want to read incomming SMS & if that came from any perticular number,
i want to read text body of that sms and write that text in .txt file.
I found couple of examples on this site.
But i just want to know that is there any easier method in Symbian v9 like (easy method for sending sms in symbian V9) "RSendAsMessage".
Thanks
Hi eric,
now i able to send SMS throught RsendAs method,
Now i want to read incomming SMS .
is there any thing which RsendAs can do the reading sms.if that so please send me the code...
or
any method to read sms..