Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am using the following code but there is no error shown but sms not goes to mentioned phone number, what is the problem?
code:
protected void Button1_Click(object sender, EventArgs e)
    {
        sendSMS("9331619281", "8845", "checking", "9331619281");

    }

  public void sendSMS(string uid, string password, string message, string no)
    {
        HttpWebRequest myReq =
        (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +
        "&msg=" + message + "&phone=" + no + "&provider=way2sms");

        HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
        System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
        string responseString = respStreamReader.ReadToEnd();
        respStreamReader.Close();
        myResp.Close();
    }
Posted
Updated 13-Feb-13 11:37am
v2
Comments
Garth J Lancaster 13-Feb-13 17:58pm    
does 'responseString' have anything in it ?
jayasree acharyya 13-Feb-13 18:27pm    
you may send me another example how to send sms to mobile numbers from web application
jayasree acharyya 13-Feb-13 18:29pm    
you can solve using your own, any how i need the solvation
Garth J Lancaster 13-Feb-13 18:37pm    
How about answering the question ? I dont know the way2sms API, but it occurs to me, looking at YOUR code, that some sort of response - maybe ok or error, is returned as a result of that call, and that response is contained in responseString ... so, set a break point on it, or log/dump the value out somewhere, and check it ... if you cant/wont learn how to debug code, any other code someone gives you may be useless

Failing all else, this may provide some help http://stackoverflow.com/questions/1590353/sending-sms-through-way2sms-help-needed
jayasree acharyya 13-Feb-13 19:10pm    
there is 2 in responsestring

Try using Hike, they have come up with some similar strategy
 
Share this answer
 
You can use n numbers of SMS gateway[^] to do this.

A similar answer has given here:
Sending Sms Using Asp.net[^]

A related Article you can find below:
Sending SMS using .NET[^]
Sending SMS using .NET through a Web service[^]


--Amit
 
Share this answer
 

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