Click here to Skip to main content
12,746,533 members (30,096 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
below is my code...but the code can only send below than 160 i can send sms more than 160 characters and the receiver receive as one message only??plss help me..

if (port.IsOpen)
    string str = "AT+CMGS=\"" + txtphno.Text.Trim() + "\"<cr>\r";
Posted 18-Sep-12 0:37am
Updated 18-Sep-12 0:39am
DaveAuld 18-Sep-12 5:39am
SMS specification is 160 characters. What you need to look at is multi-part messages.
pratyush2008 18-Sep-12 6:40am
I wanna send my whole long sms in a single sms.
Marcus Kramer 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 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 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 19-Sep-12 4:13am
Again, you need multi-part messages. See my solution for link to more details.
pratyush2008 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 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 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 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);
port.WriteLine("AT+CMGS=" + ((s.Length / 2)).ToString()+ "" + (char)13);
port.WriteLine((char)34 + pdu.ToString()+ (char)34 + '\u001F');
vithal wadje 18-Sep-12 5:39am
Make sure the maxsize of your msg textbox size
aspnet_regiis 19-Sep-12 5:05am
In that case SMS ( Short Messaging Service) has to be renamed to LMS ( Long Messaging Service).
Rate this: bad
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!
Rate this: bad
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.

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
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