Send an SMS Text Message using Twilio and ASP.Net C#

I had a few of my viewers request a video on sending an SMS message using Twilio and ASP.Net. Here it is and it is much easier than you probably thought. In this video, I walk you through the process of setting up a free Twilio account, buying a local phone number (from which you will send your first Text Message), installing the Twilio API using nuGet and implementing the API using your newly-created Twilio credentials. Awesome, huh?

View Part 2

What we are building

We are building an interface from which you can send an SMS Text message to any cell phone number you want. We will collect the message text and to number. From that data, we will spawn up a Twilio REST API object and send the Text.

How we will build

Follow my instructions in the following video and you will be well on your way to integrating SMS into your applications. It is easy, cheap and fun to do. My favorite part about this video project was thinking of the next group of things I can build to expand on this example: it really got me thinking of some cool projects!



using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Configuration;
using Twilio;
 
namespace TwilioSMSHowTo
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
 
        protected void SendMessage_OnClick(object sender, EventArgs e)
        {
            string ACCOUNT_SID = ConfigurationManager.AppSettings["ACCOUNT_SID"];
            string AUTH_TOKEN = ConfigurationManager.AppSettings["AUTH_TOKEN"];
 
            TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
 
            client.SendSmsMessage("(502) 276-8990", ToNumber.Text, Message.Text);
        }
    }
}