ASP.NET: Send Sms using asp.net MVC using Twilio

Standard

Sending sms from asp.net mvc application using Twilio service is pretty easy.

Benefits

  1. Twilio Voice

    Build smart voice applications with just a few lines of code. Add call recording, text-to-speech, conferencing and more using the web languages you know.

  2. Twilio Messaging

    Teach your apps to send and receive text and picture messages. Use a short code for high-volume applications.

  3. Twilio Client

    Twilio Client is the best way to embed voice into your WebRTC-enabled or standard browser apps via VoIP. Easily call from within your native iOS+Android apps.

  4. Phone Numbers

    Make your app global by instantly buying and provisioning Twilio phone numbers in the countries where your users are.

Installation:

  • Install Twilio from Nuget package manager or console:
    Install-Package Twilio.Mvc

    2016-09-06-11_43_40-plivoii-sln-manage-nuget-packages

    Get Free Trial Account:

    • Fill form at Sign up for free
    • You will receive Account SID, Auth Token and Sender Approved Number 

Code:

using Twilio;

public String TestTwilio(SmsModel obj)
{
    obj.Sender = "sender approved number";
    var client = new TwilioRestClient("ACCOUNT SID", "AUTH TOKEN");
    var result = client.SendMessage(obj.Sender, obj.Reciever, obj.Message);
 
    return result.ToString();
}

 

Advertisements

2 thoughts on “ASP.NET: Send Sms using asp.net MVC using Twilio

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s