C# Script

Use the code below to send SMS. You can modify this basic code to your requirements.
change values of id, pw, to and text with your user id, password, senders telephone number and the message respectively

using System.Net;
using System.IO;
WebClient client = new WebClient ();

client.Headers.Add (“user-agent”, “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)”);

client.QueryString.Add(“id”, “947123456789”);
client.QueryString.Add(“pw”, “XXXX”);
client.QueryString.Add(“to”, “94000000000”);
client.QueryString.Add(“text”, “This is an example message”);
string baseurl =”http://www.textit.biz/sendmsg”;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
data.Close ();
reader.Close ();
return (s);

Leave a Reply

Your email address will not be published. Required fields are marked *