Messages count

Post Reply
anka
Posts: 1
Joined: Thu May 16, 2019 1:04 pm

Messages count

Post by anka » Thu May 16, 2019 1:14 pm

Hi, I'd like to know if there is a way, in v2.x to get messages count (from long text).
I saw similar topic in previous version, but I'd like to count it based on text and encoding only, because I need this information in different service than this one with my SMPP client. Is this possible?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Messages count

Post by alt » Thu May 23, 2019 4:38 pm

Hello anka,

You can do this with SMS builder classes:

Code: Select all

  EncodingMapper mapper = EncodingMapper.Default;
  
  int count = SMS.ForSubmit()
                    .From("short_code")
                    .To("phone")
                    .Coding(DataCodings.UCS2)
                    .Text("long text here")
                    .Create(mapper)
                    .Length;
 
Post Reply