Sending more than one SMS...

Login to reply to this topic.
Fri, 2006-03-31 09:56
Joined: 2006-03-27
Forum posts: 5
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.

Fri, 2006-03-31 10:33
Joined: 2004-05-24
Forum posts: 982
Re: Sending more than one SMS...
Add those people in a group and send the sms to the group Wink

pirosl

Fri, 2006-03-31 13:51
Joined: 2006-03-27
Forum posts: 5
Re: Sending more than one SMS...
hi pirosl,

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
Fri, 2006-03-31 14:54
Joined: 2004-05-24
Forum posts: 982
Re: Sending more than one SMS...
You have to search in contacts

pirosl

Thu, 2006-05-25 08:08
Joined: 2006-03-28
Forum posts: 29
Re: Sending more than one SMS...
Hello Sachin,
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.
Thu, 2006-05-25 11:32
Joined: 2004-06-08
Forum posts: 148
Re: Sending more than one SMS...
You have to use CMsvEntrySelection;
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;
   }
Thu, 2006-06-01 08:38
Joined: 2006-03-27
Forum posts: 5
Re: Sending more than one SMS...
Hi kiran10182,

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);
        }

    }
Wed, 2006-06-07 10:53
Joined: 2006-03-28
Forum posts: 29
Re: Sending more than one SMS...
Hello Sachin,
Finally i solved my problem.

Thanks for yr concern towards me.

Regards.
Kiran.
  • Login to reply to this topic.