I would like to send sms messages using C# code.
For that, I am using the 'clickatell sms Gateway'.
Would anyone be able to help me with this?
Asked
Active
Viewed 1,280 times
-3

j0k
- 22,600
- 28
- 79
- 90

rohan panchal
- 881
- 3
- 15
- 32
-
2Have you tried searching something ? http://www.clickatell.com/apis-scripts/scripts/c-scripts/ – Đức Bùi Oct 31 '12 at 09:46
1 Answers
2
From their site, C# Scripts
using System.Net;
using System.IO;
WebClient client = new WebClient ();
// Add a user agent header in case the requested URI contains a
query.
client.Headers.Add ("user-agent", "Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.2; .NET CLR
1.0.3705;)");
client.QueryString.Add("user", "xxxx");
client.QueryString.Add("password", "xxxx");
client.QueryString.Add("api_id", "xxxx");
client.QueryString.Add("to", "xxxx");
client.QueryString.Add("text", "This is an example message");
string baseurl ="http://api.clickatell.com/http/sendmsg";
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
data.Close ();
reader.Close ();
return (s);

chridam
- 100,957
- 23
- 236
- 235
-
i useed this code it returns ID: 7249d373e3acddffdc2b49cd1345c71c – rohan panchal Oct 31 '12 at 09:45
-
1Bear in mind that you need to sign up for an account with Clickatell first then get the API ID together with the user credentials – chridam Oct 31 '12 at 09:46
-