Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
below is my code...but the code can only send below than 160 character...how i can send sms more than 160 characters and the receiver receive as one message only??plss help me..
 
if (port.IsOpen)
   {
    port.WriteLine("AT+CMGF=1\r");
    Thread.Sleep(25);
    string str = "AT+CMGS=\"" + txtphno.Text.Trim() + "\"<cr>\r";
    port.WriteLine(str);
    Thread.Sleep(25);
    port.WriteLine(txtMess.Text);
    Thread.Sleep(25);
   }
Posted 18-Sep-12 0:37am
Edited 18-Sep-12 0:39am
v3
Comments
DaveAuld at 18-Sep-12 5:39am
   
SMS specification is 160 characters. What you need to look at is multi-part messages.
pratyush2008 at 18-Sep-12 6:40am
   
I wanna send my whole long sms in a single sms.
Marcus Kramer at 18-Sep-12 14:22pm
   
As Dave said, "SMS SPECIFICATION is 160 characaters." You can't just break a specification rule because you feel like it. What would be the purpose to the rule.
pratyush2008 at 19-Sep-12 0:53am
   
my purpose is i want to sent a sms having more than 160 chars.
Let for example i wanna send a sms having 200 chars.so my requarement is when a user shall get the sms in his mobile he wud get whole 200chars sms in a single sms format.Not like 160 char are in 1 sms and rest 40 chars in a other sms.
DaveAuld at 19-Sep-12 4:13am
   
Again, you need multi-part messages. See my solution for link to more details.
pratyush2008 at 19-Sep-12 6:17am
   
I ws reffered that link.Bt unable to understand that.Can u send me how can i send a message ,
"Our success as a nation is not measured by how many years we have governed or how many wars we have won. It is measured by the quality of life which we have created for the society that our ideals were founded upon."...
Plz help.
DaveAuld at 19-Sep-12 6:58am
   
No I cannot send how you can send the message. I do not have any example code, you need to go do some of your own research. The wiki entry doesn't look like anything complicated, and as I said, there are tons of examples out there. I don't know how many times SMS related questions are asked on codeproject, but it is alot. Go do your own work.
Marcus Kramer at 19-Sep-12 9:01am
   
If you can't understand the wiki page, then perhaps if you googled "Concatenated SMS tutorial", you would find something good. It took me a total of 10 seconds to do this and the very first link is a tutorial. Google is your friend, visit him often.
pratyush2008 at 19-Sep-12 10:19am
   
i ws reffered goggled.I reffered how to send sms in PUD format.Below is my new code.Bt stl my problem same.Unable to send.
//PUD Mode
SmsSubmitPdu pdu;
pdu = new SmsSubmitPdu(txtMess.Text, txtphno.Text);
 
port.WriteLine("AT+CMGF=0" + (char)13);
Thread.Sleep(250);
MessageBox.Show(port.ReadExisting());
port.WriteLine("AT+CMGS=" + ((s.Length / 2)).ToString()+ "" + (char)13);
Thread.Sleep(250);
port.WriteLine((char)34 + pdu.ToString()+ (char)34 + '\u001F');
Thread.Sleep(250);
MessageBox.Show(port.ReadExisting());
vithal wadje at 18-Sep-12 5:39am
   
Make sure the maxsize of your msg textbox size
aspnet_regiis at 19-Sep-12 5:05am
   
In that case SMS ( Short Messaging Service) has to be renamed to LMS ( Long Messaging Service).
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

no it's SMS -Short message service
there is limitation so, you can not do that
split long sms in two or more sms and then send it
Happy Coding!
Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

As I said in my comment you need to look at multi-part messages to achieve what you want.
 
A little bit of googling by yourself would help you find the information is readily available.
 
Why don't you start by reading Concatenated SMS[^] on wiki.
 
From this you should be available to find plenty of examples on the net, just by tailoring your keyword search on the big G.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 95
4 Maciej Los 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100