C#

SMS Scripts - C#

Our ready-made scripts help you to send and receive sms through our Bulk SMS Gateway through your chosen programming language. The scripts works very well with the HTTP API. Please click here to Contact Us for an HTTP API SMS Account.

Send SMS with C#:

Use the C# code below to send SMS via our Bulk SMS Gateway. Simply Contact Us for an Bulk SMS HTTP API test account, and you will automatically receive 10 free credits to trial our service.


Code Sample:

using System.Net;
using System.IO;
WebClient httpclient = 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;)");
httpclient.QueryString.Add("username", "xxxx");
httpclient.QueryString.Add("password", "xxxx");
httpclient.QueryString.Add("type", "TEXT");
httpclient.QueryString.Add("sender", "xxxx");
htpclient.QueryString.Add("mobile", "xxxx");
httpclient.QueryString.Add("message", "This is an example message");
string baseurl ="http://sms.shreeweb.com/sendsms/sendsms.php";
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
data.Close ();
reader.Close ();
return (s);

Last Updated on Thursday, 10 October 2013 01:26
 
Copyright © 2017 Shreeweb | All Rights Reserved.