Sending Sms from an ASP.NET Website

Sending SMS from an ASP.NET website

Web services are the best way to do it. I use Twilio on a site, and it was incredibly easy to get set up and working. Scalability is no issue, and you will more than make up for the cost in not having to spend developer hours building your own solution.

Twilio: http://www.twilio.com/

Twilio libraries available for .NET: https://www.twilio.com/docs/csharp/install

From the twilio-csharp project, here is the example of how to send an SMS (I took this from twilio-csharp. Just reposting it to show how easy it is)

static void Main(string[] args)
{
TwilioRestClient client;

// ACCOUNT_SID and ACCOUNT_TOKEN are from your Twilio account
client = new TwilioRestClient(ACCOUNT_SID, ACCOUNT_TOKEN);

var result = client.SendMessage(CALLER_ID, "PHONE NUMBER TO SEND TO", "The answer is 42");
if (result.RestException != null) {
Debug.Writeline(result.RestException.Message);
}
}

How to send SMS through Asp.net Web Application

You will need to utilize some sort of telephony provider to achieve this. I personally am a big fan of Twilio. They are very reasonable rates and expose an API with language specific API wrappers. .NET in particular has several, including an official one.

Code samples and walkthroughs are available here.

The performance impact is minimal, as you essentially construct an XML message that gets passed to a Twilio endpoint. The heavy lifting is off your shoulders as its more a system of passing and receiving XML messages.

Hope that helps, it is a very easy platform to work with.

How to send sms from ASP.NET application?

You would need to buy 3rd party services like http://www.twilio.com/

How to send SMS from asp.net application

You need to find a gateway or such kind of service first. The service provider will probably offer you the method or API to integrate your web site to their service. This topic has also been discussed in these forums for several times before. You can search for those threads and see if they are suitable for you.

Implement SMS sending functionality in ASP.NET C# web application

I had implemented a project where SMS text was generated after user selects some text and forwarded it to mobile numbers fetched from database.

The SMS gateway provider gave us a URL in which the SMS text and the mobile numbers were embedded as parameter values , something like below

string url =@"http://10.10.10.10/id=ourId&password=xyz&message="+smsText+"&mobileNum="+num[i];

This string string contained url which was called using WebClient class

using (WebClient client = new WebClient())
{
client.DownloadString(url);
}


Related Topics



Leave a reply



Submit