Read-only archive of the All About Symbian forum (2001–2013) · About this archive

send SMS in Series 60

1 replies · 1,625 views · Started 29 July 2004

Hi
Please take a look at the code I try in order to send a sms message (for now there is no text in it ).

in the emulator the execute goes without errors and with a system info message the the mms message was sent ,
In the Nokia 6600 there is no error , but also no info message , and no sms is sent (at least not to the number I wrote , which is a regular mobile ).

*** what do I do wrong ?

*** also , how can I add a simple text or header to the message , like for example "Start Message"?

Thanks in advance , TE


class CMTMSmsSender : public MMsvSessionObserver
{
public:
CMTMSmsSender();
~CMTMSmsSender();
void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
void SendL();
CMsvSession * iSession;
CMmsClientMtm * iMmsMtm;
CClientMtmRegistry * iMtmReg;
};

void CMyAppAppView::CmdSendL()
{
CMTMSmsSender * smsSender = new (ELeave) CMTMSmsSender;
smsSender->Send();
}

void CMTMSmsSender::Send()
{
iSession = CMsvSession::OpenSyncL(*this);
iMtmReg = CClientMtmRegistry::NewL(*iSession);
iMmsMtm =
(CMmsClientMtm*)iMtmReg->NewMtmL(KUidMsgTypeMultimedia);
// Set context to the parent folder (Drafts)
iMmsMtm->SwitchCurrentEntryL(KMsvDraftEntryId);
iMmsMtm->CreateMessageL(iMmsMtm->DefaultSettingsL());
_LIT(KPhoneNumber, "0501234567"😉;
iMmsMtm->AddAddresseeL(KPhoneNumber);
// Set the message�s status flags appropriately
TMsvEntry ent = iMmsMtm->Entry().Entry();
ent.SetInPreparation(EFalse);
ent.SetVisible(ETrue);
iMmsMtm->Entry().ChangeL(ent); // Commit changes
iMmsMtm->SaveMessageL();
// Start sending the message via the Server MTM to the MMS
// server
CMsvOperationWait* wait = CMsvOperationWait::NewLC();
wait->iStatus = KRequestPending;
CMsvOperation* op = iMmsMtm->SendL(wait->iStatus);
wait->Start();
CleanupStack::PushL( op );
CActiveScheduler::Start(); // returns when wait completes
CleanupStack::PopAndDestroy(2); // op, wait
}

now I understand that this code is for MMS and not SMS !!!
I need a simple SMS text message ,
by now couldnt find a simple example for the series 60 ,
anyone knows of one ???