Click here to Skip to main content
15,881,695 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello friends!

I have an urgent question.

I am a beginner and I was trying to send SMS in C#. I found this C# SMS solution, however I could not make it work. The message was not showing in the SMS Gateway after I sent it. I must have missed some settings but I cannot figure out what.

I could really use some help.

Thanks in advance.
Posted
Comments
[no name] 24-Feb-15 4:07am    
Hi, Your c# code ?
Isaac Philips 24-Feb-15 4:14am    
I used the code shared here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=9489&lngWId=10
Richard MacCutchan 24-Feb-15 6:56am    
Then you should really go and ask the person who wrote it.

Try this code :
C#
public void send(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");
(HttpWebRequest)WebRequest.Create("puturlink = "+"UrUsername"+ "&password=" + "UrPassword" + "&sender=" +"UrSenderID"+ "&to=" +no+ "&message=" + message+ "&reqid=1&format={json|text}&route_id=route+id&callback=Any+Callback+URL&unique=1&sendondate=" +"10-10-2014T05:17:52"+"");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}

//Button Click code
protected void btn_send_Click(object sender, EventArgs e)
{

send(txt_message.Text, txt_mobile.Text);

ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('sms sent successfully...');", true);

}
 
Share this answer
 
have a look at this article

Sending-an-SMS-using-NET
 
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