Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
HI
how to send sms using way2sms and fullonsms in asp.net
Posted

 
Share this answer
 
Try below code for way2sms.



C#
protected void Page_Load(object sender, EventArgs e)
{
    List<string> nos = new List<string>();
    nos.Add("9320xxxxxx");
    nos.Add("9940xxxxxx");
    nos.Add("9789xxxxx");
    foreach (string no in nos)
    {
        send("9840xxxxxx", "xxx", "Sending sms", no);
    }
}
 
public void send(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();
}
 
Share this answer
 
v2
this code throws error as "An exception of type 'System.Net.WebException' occurred in System.dll but was not handled in user code

Additional information: The remote server returned an error: (403) Forbidden.
"


Please help me....
 
Share this answer
 
Comments
CHill60 19-Feb-15 10:23am    
What code? Do not post questions as solutions to old posts.
If you want to respond to a particular post use the "Have a Question or Comment" link next to or use the "Ask a Question" link to post your own question. Remember to include the relevant code and a description of the problem. If an error is thrown then indicate which line of code throws the exception
Member 11541609 7-Apr-15 9:45am    
why is giving 404 error that...

System.Net.WebException:The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.GetResponse() at _Default.send(String uid, String password, String message, String no)
CHill60 7-Apr-15 9:47am    
I don't know! What code? What remote server? We can't see your screen, your HDD or read your mind.
If you want to ask a question of your own then use the "Ask a Question" link at the top of the page. Be sure to include all of the relevant detail.

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