Sample code – HTTP(s) – C#

The following Sample code shows, how to send make an integration in C# with HTTPs:

using System;
using System.Net;
using System.IO;
using System.Web;

protected void SendMessage()
{
string username= “+4540818824″;
string password=”12345″;
string tophonenumberwithcountrycode=”+4540818824″;
string fromMax11Char=”Santa”;
string theMessage = “Hello world! I can send special chars like æ ø and å”;

string pathtouse = “https://api.suresms.com/Script/SendSMS.aspx?login=” + username + “&password=” + password +
“&to=” + tophonenumberwithcountrycode + “&from=” + fromMax11Char + “&Text=” + WebUtility.UrlEncode(theMessage);

/* Call the Path */
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(pathtouse);
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
}

It is nessasary to change the parametres, so that they do match the username and Password, you recieved when opening your SureSMS account!

Should you have any questions, allways fell welcome to send an E-mail to support@suresms.com. We are looking forward to helping you.

In case your system is running on a server without direct acces to the internet, you may want to use our SMTP solution. With a SMTP solution you can send a message from your C# application, if you have acces to  an intern mail server, which can forward your message.

You can read more about our SMTP solution in our website. 

Need an account?

Do you still need an account or a free test account? Follow this link and we will make you one in 5 minuts.