Shawn Smith

Shawn Smith

  • NA
  • 12
  • 1.7k

GSM COMM cant send more than 160 characters sms

Jul 2 2018 6:12 AM
I have searched a lot but still couldnt find exactly what am looking for.
 
Actually i'm working on a winforms app that will allow user to send bulk sms. What i have acheived so far is that i can send messages that are <= 160 characters but problem occurs when a message gets longer that 160 characters. I don't get any error and sms seemed to have been sent but its not actually.
 
I'm sharing my code snippet that is used to send sms. Please have a look at it and letme know  where the problem is.
 
Thanks. 
 
SmsSubmitPdu[] pdus; 
int len = message.Length;
if (len <= 160)
{
comm.Open();
pdus = SmartMessageFactory.CreateConcatTextMessage(message, number);
foreach (SmsSubmitPdu pdu in pdus)
   {
      comm.SendMessage(pdu);
   }  
comm.Close();
}
else
{
comm.Open();
pdus = SmartMessageFactory.CreateConcatTextMessage(message, number);
foreach (SmsSubmitPdu pdu in pdus)
{
   comm.SendMessage(pdu);
}
comm.Close();
}
 

Answers (1)