Facebook Like Box

Main Menu

Encoding SMS in PDU format in .NET - Encoding Multipart SMS in PDU in .NET Framework

Now I will explain how to compose a multipart SMS using this library. it's pretty much simple as a single SMS with minor changes. See the following code.

//Compose PDU SMS
SMS sms = new SMS();
//Setting direction of sms
sms.Direction = SMSDirection.Submited;
//Sets the flash property of SMS
sms.Flash = false;
//Set the recipient number
sms.PhoneNumber = 0012713313311;
//Sets the Message encoding for this SMS
sms.MessageEncoding = SMS.SMSEncoding._7bit;
//sms.MessageEncoding = SMS.SMSEncoding.UCS2;
//Set the SMS Message
sms.Message = "This is a long text message greater than 160 characters. You can encode it to PDU format using the SMS-PDU lib for .NET, It also supports UCS-2 encoding, and special characters like { [ ] } are also supported. Its quite simple to use in your code.";
//now check for multipart sms
string[] messagesParts;
if (sms.Message.Length > 160)
{
    messagesParts = sms.ComposeLongSMS();
}
//messageParts is the composed PDU for multipart sms encoded in 7 bit.

Finally, If you want to compose Unicode SMS, it's also supported, All of the above coding remain same except


sms.MessageEncoding = SMS.SMSEncoding.UCS2; //setting encoding to Unicode.

I hope this library is easy to use, and will help you to build your own state of art SMS supported application.

Comments   

 
0 #7 Hard Code 2013-10-24 07:27
Quoting Ryan:
From memory I had to make some modifications to fix the ComposeLongSMS. It didn't work back in June without it, and the latest version hasn't been updated since. The fix is here: https://code.google.com/p/sms-pdu/issues/detail?id=4


Thanks, I will have a look on this issue, and will update the code accordingly on SVN.
Quote
 
 
0 #6 Hard Code 2013-10-24 07:06
ummarbhutta(at) gmail_dot_com
Quote
 
 
0 #5 Ryan 2013-10-24 07:06
From memory I had to make some modifications to fix the ComposeLongSMS. It didn't work back in June without it, and the latest version hasn't been updated since. The fix is here: https://code.google.com/p/sms-pdu/issues/detail?id=4
Quote
 
 
0 #4 Hard Code 2013-10-24 07:02
Quoting Stefan:
Please sent me that libraray..i hava oldest version without ComposeLongSms method ?

@Stefan, you can download the latest version from the SVN (google code repository) as given in post. If there is any issue please let me know.
Quote
 
 
0 #3 Ryan 2013-10-24 07:02
Quoting Stefan:
Please sent me that libraray..i hava oldest version without ComposeLongSms method ?


Post your email.
Quote
 
 
0 #2 Stefan 2013-08-28 12:28
Please sent me that libraray..i hava oldest version without ComposeLongSms method ?
Quote
 
 
0 #1 Ryan 2013-06-06 09:16
Exactly what I needed!
If only I found it 4 hours ago.

Thanks!
Quote
 

Add comment


Security code
Refresh