Thursday, January 22, 2015

HOW TO SEND MESSAGE(SMS)

Description:
This label explains about how to send SMS.
Code Example:


//classes to be used to send SMS.
RSendAs iSendAs;
RSendAsMessage iSendAsMessage;

User::LeaveIfError(iSendAs.Connect());
iSendAsMessage.CreateL(iSendAs, KUidMsgTypeSMS);
iSendAsMessage.AddRecipientL("Recipient MobileNumber",RSendAsMessage::ESendAsRecipientTo);
iSendAsMessage.SetBodyTextL("Text to be sent"); 
iSendAsMessage.SendMessageAndCloseL();

/*This s to show information note for sending message.*/
HBufC* textResource = StringLoader::LoadLC(R_MESSAGE_SENT_SUCCESSFULLY); CAknInformationNote* informationNote;
informationNote = new ( ELeave ) CAknInformationNote;
// Show the information Note with 
// textResource loaded with StringLoader.
informationNote->ExecuteLD( *textResource);
// Pop HBuf from CleanUpStack and Destroy it.
CleanupStack::PopAndDestroy( textResource );

0 comments:

Post a Comment