Windows Forms: How to send SMS Messages to Mobile or Cell phone in C#

How to send SMS to mobile or cell phone in C#

Step 1: Create a new project called SmsMessages

send-sms-clickatellStep 2: Design your form as below

send sms clickatell

Add code to handle btnSend event click

private void btnSend_Click(object sender, EventArgs e)
{
    try
    {
        WebClient client = new WebClient();
        //Call web api to send sms messages
        Stream s = client.OpenRead(string.Format("http://api.clickatell.com/http/sendmsg?user=YOUR USERNAME&password=YOUR PASSWORD&api_id=YOUR ID&to={0}&text={1}", txtTo.Text, txtMessage.Text));
        StreamReader reader = new StreamReader(s);
        string result = reader.ReadToEnd();
        MessageBox.Show(result, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}

To play demo, you need to create an account at clickatell website

VIDEO TUTORIALS