Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
below is my code...Me using a GSM modem. But still I can't get success. Can anyone restify where is my mistake in my below code.Please help.

I m trying to send Text: "GudMorn India"
and Tel.No is: 9040626890

C#
//PUD Code
port.WriteLine("AT+CMGF=0");
Thread.Sleep(500);
port.WriteLine("AT+CMGS= 25");
Thread.Sleep(500);
port.WriteLine( (char)34 + "0011000A8109042686090000A70DC73AB9F996BB414937391D06"+ (char)34 + '\u001F');
Thread.Sleep(500);
Posted
Updated 20-Sep-12 8:04am
v3
Comments
[no name] 20-Sep-12 9:27am    
Knowing what errors you are getting or what "i cant get success" means might help a great deal.
Ankur\m/ 20-Sep-12 9:34am    
The very first thing you need to check is if your modem supports PUD format? There are commands to do that. I do not remember them now but you can find them easily bu Googling.
If it does, the next step is to configure it to work in PUD mode and then you need some code which converts your data into PUD format. You need to be sure that your input is correct.
Volynsky Alex 20-Sep-12 11:34am    
Try to read following post:
http://www.codeproject.com/Articles/15924/Library-for-Decode-Encode-SMS-PDU
mk4you7 20-Sep-12 11:41am    
Very nice link
pratyush2008 21-Sep-12 1:03am    
I ws already saw that link.By using PUDConverter i got that pud strig.
my real code is below.

SmsSubmitPdu pdu= new SmsSubmitPdu(txtMess.Text, txtphno.Text,"");
String S=pud.Tostring(); //"0011000A8109042686090000A70DC73AB9F996BB414937391D06"
port.WriteLine("AT+CMGF=0"+ (char)13);
Thread.Sleep(500);
port.WriteLine("AT+CMGS="+((s.Length / 2)-1).ToString()); //"AT+CMGS= 25"
Thread.Sleep(500);
port.WriteLine( (char)34 + s + (char)34 + '\u001F');
Thread.Sleep(500);
Still me not getting sucess.means my code cant able to send SMS.Plz Help.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900