Help On Sending Sms in c#

Posted by Vijayar under ASP.NET on 1/27/2012 | Points: 10 | Views : 1377 | Status : [Member] | Replies : 3
HI
I need to send sms by using free Api.Can we send sms like this.If So please send me the code .It's Very Urgent

vijaya


Responses

Posted by: Hemanthlaxmi on: 1/27/2012 [Member] Starter | Points: 25

Up
0
Down
You can use some webservice like

For sending SMS to the world: http://www.webservicex.com/sendsmsworld.asmx?WSDL
For sending SMS to India: http://www.webservicex.net/SendSMS.asmx?WSDL

for sending SMS with the help of GPRS(General Packet Radio Service ).
refer this for more details and example
http://www.codeproject.com/KB/cpp/SendSmsThroughWS.aspx

If this helps you .
Please "Mark as Answer"

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 1/29/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
Can u explain in details ,the steps to be folloe\wed how to use this webservice

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nsatija on: 2/1/2012 [Member] Starter | Points: 25

Up
0
Down
1. Create a new page called Demo.aspx
2. In the codebehind file demo.aspx.vb copy paste the following code
Imports System.Net  

Imports System.IO

Partial Class demo
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
SendSMS("18479790553", "ToNumber", "You have an appointment on 1-20-2012 at 3:00pm with Dr. McAndrews at the Carson Office. ")
End Sub

Sub SendSMS(ByVal FromNumber As String, ByVal ToNumber As String, ByVal SMS As String)
Response.ContentType = "text/xml; charset=utf-8"
Dim url As String = "https://www.sendandreceivesms.com/api/"
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
request.Method = "POST"
Dim postData As String = "FromNumber=" & FromNumber
postData += "&"
postData += "ToNumber=" & ToNumber
postData += "&"
postData += "SMS=" & SMS
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
request.ContentType = "application/x-www-form-urlencoded"
request.Headers.Add("APIToken", "GoOu9H0h9G")
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim _webresponse As WebResponse = request.GetResponse()
dataStream = _webresponse.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
Response.Write(responseFromServer)
reader.Close()
dataStream.Close()
'Response.Close()
End Sub
End Class


Nick S

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response