Kanishka Kanishka - 1 month ago 17
ASP.NET (C#) Question

Sending SMS from an ASP.NET website

Is there a way to send SMS from an ASP.NET website using a Web API? I know about web services, but don't know how to call those services from my app.

Answer Source

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);
    }    
}