首 页 | 新 闻 | Symbian | Windows Mobile| J2ME | 下载中心 | 游戏策划 | 购书指南 | 移动开发视频教程
您现在的位置: 开发视界 >> Symbian英文资料 >> Network >> 文章正文
Programatically sending an SMS Message
作者:佚名    文章来源:转载    更新时间:2007-3-6 23:26:11

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>

...

 // Open a connection with the SendAs server
 RSendAs saSrv;
 saSrv.Connect();
 CleanupClosePushL(saSrv);
       
// Create your message
RSendAsMessage msg;
msg.CreateL(saSrv, KSenduiMtmSmsUid);
CleanupClosePushL(message);
msg.AddRecipientL(aRecipientNumber,RSendAsMessage::ESendAsRecipientTo);       
msg.SetBodyTextL(aMessageText);
 
// Send the message
message.SendMessageAndCloseL();
       
// Cleanup
CleanupStack::Pop(&message);
CleanupStack::PopAndDestroy(&saSrv);

相关文章:
Sending a message from Symbian C++ to a J2ME MIDlet.
Mission Impossible : Getting the Location string.
Sending a message from Symbian C++ to a J2ME MIDlet.
Mission Impossible : Getting the Location string.