Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending SMS from an ASP.NET website [closed]

Tags:

c#

asp.net

sms

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.

like image 686
Kanishka Avatar asked Mar 29 '11 04:03

Kanishka


People also ask

How can I send free SMS from ASP net to mobile?

You need to substitute the user name password and sender id in the respective places in the URL. You need to also specify the mobile number too in the URL. If you want to send the SMS to multiple numbers then you need to provide those numbers in comma-separated format. That's all!

Is there any free API to send SMS?

A free SMS API allows you to set up an SMS gatewayto send SMS messages directly from a software or application solution. Thus, the integration of SMS sending requests in the heart of your algorithms allows you to automate the sending, receiving and control of SMS messages from your website or your business software.


1 Answers

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);     }     } 
like image 199
mfanto Avatar answered Oct 13 '22 10:10

mfanto