Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a table with a table column named as 'phone'. It holds mobile number.
I assign this 'phone' to a variable v_phone. I used the following code to send the
sms. It is not working.

string v_phone = ds3.Tables[0].Rows[i]["phone"].ToString();
WebClient client = new WebClient();
string baseurl = "http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&mobiles=v_phone&message=hello&sender=test";
Stream data = client.OpenRead(baseurl);
                    StreamReader reader = new StreamReader(data);
                    string s = reader.ReadToEnd();
                    data.Close();
                    reader.Close();


If I use the exact mobile number in place of that variable, it is working. Can anyone help me out.
Posted
Updated 28-Dec-12 21:46pm
v2

1 solution

Why do you think, that the v_phone string will be replaced by the variable value?
And you have tried to debug the v_phone string, and what you have seen there has the proper format accepted by the gateway?
Try:
string baseurl = "http://sms.ssdindia.com/sendhttp.php?user=rajnamm&password=298426&mobiles="+v_phone+"&message=hello&sender=test";
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 29-Dec-12 4:20am    
Thanks, Zoltan. It works.

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