×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    76

    How to get To/From address from Message?

    Hi,
    i want to extract the from address and body from the incoming SMS, but it is failed to extract the from address (and may be body not confirmed) from SMS,
    i am working on s60 3rd fp1, so kindly help me , using following code:

    ........
    // Get address of received message.
    TBuf<KSmsMessageLength> iAddress(iMsvEntry->Entry().iDetails);
    if (store->HasBodyTextL())
    {
    CSmsClientMtm* SmsMtm = STATIC_CAST(CSmsClientMtm*,iEngine->iClientMtmReg->NewMtmL(KUidMsgTypeSMS));
    if(SmsMtm)
    {
    CleanupStack::PushL(SmsMtm);
    SmsMtm->SwitchCurrentEntryL(iNewMessageId);
    SmsMtm->LoadMessageL();
    CDesCArrayFlat* AddressArray = new (ELeave)CDesCArrayFlat(1);
    HBufC* BodyBuffer = HBufC::NewL(SmsMtm->Body().DocumentLength());
    TPtr BodyPoint(BodyBuffer->Des());
    SmsMtm->Body().Extract(BodyPoint,0,SmsMtm->Body().DocumentLength());
    for(int i = 0; i < SmsMtm->AddresseeList().Count(); i++)
    {
    TBuf<100> buf;
    buf.Copy(SmsMtm->AddresseeList()[i]);
    AddressArray->AppendL(buf);
    }

    TMsvEntry msvEntry((SmsMtm->Entry()).Entry());
    iObserver.MessageReceivedL(iNewMessageId,AddressArray,BodyBuffer);
    CleanupStack::PopAndDestroy(1);
    }
    }

    thanx in advance.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: How to get To/From address from Message?

    Forum Nokia has a main site, www.forum.nokia.com, there you can click on Documentation/Symbian C++ on the left, and browse examples under the "Messaging" link.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: How to get To/From address from Message?

    Also it is worth trying to search on Wiki. There are good articles on messaging.

    Kiran.
    Nokia Developer Wiki Moderation team

  4. #4
    Regular Contributor
    Join Date
    May 2008
    Posts
    65

    Re: How to get To/From address from Message?

    CSmsHeader& header = iSmsInMtm->SmsHeader();
    aAddress.Append( header.FromAddress() );

Similar Threads

  1. Is new message type possible on S60 Platform?
    By tigle in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-10-27, 13:03
  2. Setting sender address in submit message
    By doshiaj in forum General Messaging
    Replies: 1
    Last Post: 2003-04-02, 08:15
  3. problem to send a service loading message push for 8310
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 12:39
  4. Problem to send a service loadinfd push message for 8310
    By alinesimon in forum Smart Messaging
    Replies: 1
    Last Post: 2002-05-03, 10:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×