Sending more than one SMS...
| Fri, 2006-03-31 09:56 | |
|
Hi All,
I have a list of Mobile No in my APP, i want to send SMS to all this members though my APP. Iam able to send sms to one member right now, but dont know how to send sms to list of peoples. i want to do some thing like this.. for(i=0;i<count;i++) { TBuf<20> temp; temp.Append((*arraysmsno)[i]);         static_cast<CSmsSendHandler*>(iSendHandler)->SendToL(temp); } can any one help me. Thanks and regards. |
|






Forum posts: 982
pirosl
Forum posts: 5
Thanks for your instant reply.
I searched in symbian help document, but i didnt find any good help for it.
As iam very new to symbian, and dont know how to create groups for sending sms. Could u please guide me finding some code or any document relate to it.
Thanks and Regards
Forum posts: 982
pirosl
Forum posts: 29
Have u resolved yr problem of sending a message to a Group?
Actually i m developing one application which requres the same.
Please help me if u have done it.
Thnaks.
Forum posts: 148
Here is my function.
CBaseMtm* iMtm;
void CSender::SendMessage(CMsvEntrySelection* aSelection)
{
// This moves the message entry to outbox, we'll schedule it for sending after this.
iBrSentMessages=0;
iBrMessagesToSend=aSelection->Count();
for(int i=0; i< aSelection->Count(); i++)
{
TMsvId movedId = MoveMessageEntryL((*aSelection)[i]); // move message to outbox
(*aSelection)[i] = movedId;
}
CMsvOperation* operation = NULL;
CleanupStack::PushL(operation); //add operation to CleanupStack
TBuf8<1> dummy;
waiter->Start();
CleanupStack::PushL(waiter);
operation=iMtm->InvokeAsyncFunctionL(
ESmsMtmCommandScheduleCopy,
*aSelection,
dummy,
waiter->iStatus);
CActiveScheduler::Start();
CleanupStack::Pop(1); // waiter
CleanupStack::PopAndDestroy(1); // waiter, operation
bIsSending = ETrue;
}
Forum posts: 5
I have found solution for it...I dont know weather any one likes it or not...
i have a function SendSMS...with following code...
for(i=SMSCount; i < count; i++)
{
TBuf<20> temp;
TBuf<20> SMSNO;
SMSNO.Zero();
SMSNO.Append(_L("9822186132"));
SendToL(SMSNO,aSmsText)
               }
In Above function SMSCount is a globel variable.
SendToL() function execute RunL() of sendSMSHandler class...
In RunL() i have increased value of SMSCount by one and againg called SendSMS() from RunL() inself.
void CSmsSendHandler::RunL()
  {
  ASSERT(iOperation);
  // Mtm's should always return KErrNone and clients should rely on other means
  // to check on operation progress
  User::LeaveIfError(iStatus.Int());
  // Determine the current operations progress
  // Note : This class is only appropriate to Locally acting operations
  //    such as Create, Move, Delete.
  //    For the CBaseMtm::InvokeAsyncFunctionL, used to schedule the messange for sending,
  //    no status is available as this is not a local operation, so we use the fact
  //    that sent messages are moved to the 'Sent' folder which we can detect using
  //    the HandleSessionEventL
  TMsvLocalOperationProgress progress;
  TUid mtmUid = iOperation->Mtm();
  if (mtmUid == KUidMsvLocalServiceMtm)
    {
    progress = McliUtils::GetLocalProgressL(*iOperation);
    User::LeaveIfError(progress.iError);
    }
  else
    {
    // The request to schedule the message is the only non-local operation
    // we request from this example
    if (iPhase != EWaitingForScheduled)
      {
      User::Panic(KSms, ESmsStateError);
      }
    }
  delete iOperation;
  iOperation = NULL;
  switch (iPhase)
    {
    case EWaitingForCreate:
      iObserver.HandleStatusChange(MMsvObserver::ECreated);
      SetMtmEntryL(progress.iId);
      if (InitializeMessageL())
        {
        if (MoveMessageEntryL(KMsvGlobalOutBoxIndexEntryId))
          {
          iPhase = EWaitingForMove;
          }
        else
          {
          iPhase = EIdle;
          }
        }
      else
        {
        iPhase = EIdle;
        }
      break;
    case EWaitingForMove:
      {
      iObserver.HandleStatusChange(MMsvObserver::EMovedToOutBox);
      // We must create an entry selection for message copies
      // (although now we only have one message in selection)
      CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
      CleanupStack::PushL(selection);
      selection->AppendL(progress.iId);
      // schedule the sending with the active scheduler
      SetScheduledSendingStateL(*selection);
      CleanupStack::PopAndDestroy(selection);
      iPhase = EWaitingForScheduled;
      }
      break;
    case EWaitingForScheduled:
      {
      const TMsvEntry& msvEntry = iMtm->Entry().Entry();
      TInt state = msvEntry.SendingState();
      if (state != KMsvSendStateScheduled)
        {
        iObserver.HandleError(MMsvObserver::EScheduleFailed);
        iPhase = EIdle;
        }
      else
        {
        iObserver.HandleStatusChange(MMsvObserver::EScheduledForSend);
        iPhase = EWaitingForSent;
        }
      }
// INFO_MSG(_L("MSG Send"));
//////////////////////////////////////////////////////////////////////////////////////////////
iLoginView->SMSCount=iLoginView->SMSCount+1;
iLoginView->sendSMS();
//////////////////////////////////////////////////////////////////////////////////////////////
      break;
    case EWaitingForDeleted:
      iObserver.HandleStatusChange(MMsvObserver::EDeleted);
      iPhase = EIdle;
      break;
    case EWaitingForSent: // We handle this in HandleSessionEventL
    case EIdle:      // Shouldn't get triggered in this state
    default:
      ASSERT(EFalse);
    }
  }
Forum posts: 29
Finally i solved my problem.
Thanks for yr concern towards me.
Regards.
Kiran.