Click here to Skip to main content
16,016,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to develop sms to mobiles from my asp.net i have regiistered in www.clickatell.com and i got url and api_id.
plz check the following code,it seems its not working even i am not getting error and message also.

Imports System.Data
Imports MySql.Data.MySqlClient
Imports System.String
Imports System.Net
Imports System.IO
Imports System.IO.StreamReader


Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
username = TextBox1.Text.ToString()
password = TextBox2.Text.ToString()
apiid = TextBox3.Text.ToString()
smsto = TextBox4.Text.ToString()
text = TextBox5.Text.ToString()
Dim client As WebClient = New WebClient
client.Headers.Add("venu", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR1.0.3705;)")
client.QueryString.Add("user", username)
client.QueryString.Add("password", password)
client.QueryString.Add("api_id", apiid)
client.QueryString.Add(to", smsto)
client.QueryString.Add("text", text)
Dim baseurl As String = "http://api.clickatell.com/http/sendmsg"
Dim data As Stream = client.OpenRead(baseurl)
Dim reader As StreamReader = New StreamReader(data)
Dim s As String = reader.ReadToEnd()
data.Close()
reader.Close()
Return


End Sub
End Class
Posted

1 solution

Well, I did this[^], and got links like these and many more:
Articles:
Sending SMS using .NET through Web service[^]
Sending SMS text messages using ASP.NET scripts[^]

Discussion links:
sending sms using vb.net[^]
how to send sms through asp.net with c#? [^]

Nutshell: ASP.NET does NOT have any inbuilt API support to send out an SMS. You need to go for a third party solution or use something that is found on the Internet. Articles and discussions above should help you out.
 
Share this answer
 
Comments
venubabu k 25-Oct-10 2:54am    
Thanking You sir,
it seems it may work, so i have to try it now i will catch u after getting result.
venubabu k 25-Oct-10 3:17am    
sorry sir i unable to add web reference i am getting error check it sir why i am getting this error.


There was an error downloading 'http://www.webservicex.net/SendSMS.asmx'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 173.201.44.188:80
Sandeep Mewara 25-Oct-10 3:20am    
Well, you need to have a webservice similar to that with credentials. Did you thought you can just go ahead and use someone else webservice?

As told, it's not free or available API. You need to talk to third party.

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