Answered by:
Send / Receive SMS

Question
-
User-1543610904 posted
I want to send the updates to the web app user regularly, as well as provide them facility that the users can send SMS to the web app and the SMS Content sholud be stored in the database.
How can this be done in C# ASP.NET?Saturday, April 19, 2014 2:32 PM
Answers
-
User-760709272 posted
http://forums.asp.net/t/1459384.aspx?Sending+an+SMS+Message+with+ASP+NET
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, April 19, 2014 3:17 PM -
-
User281315223 posted
You'll likely need to use some type of service or SMS Gateway to handle sending SMS messages, which may not always be free (much like sending text messages or phone calls often aren't). The details and implementations may vary for each of them, but you will certainly need an active internet connection (which I am assuming they meant by the modem) to use them (as you would with any sort of web-based technology)
I'll list a few options for highly recommended SMS Gateways for .NET as well as the code for sending messages for one in particular.
Overview and Suggestions
I would recommend checking out the following Stack Overflow discussion on SMS Gateways, which recommended Clickatell. However, there are tons of them out there, so I would suggest doing some research and figuring out what works best for you :
- Twilio Cloud Communications - I've heard good recommendations for this one.
- MXTelecom
- RedOxygen SMS Gateway
- Intellisoft
- OpenMarket
- Panacea Mobile
Wikipedia also features a fairly comprehensive listing of SMS Gateways as well.
An Actual Example
You will need to use some type of service most likely to perform this, especialy if you are going to be performing it on a large scale.
SMSified appears to have quite an extensive and friendly API for performing this very task.
A fully featured example on sending outbound SMS messages using SMSified can be found here and seen below :
// SMSified API endpoint. string webTarget = "https://api.smsified.com/v1/smsmessaging/outbound/{0}/requests"; // Parameters to send with API request. string webPost = "address={0}&message={1}"; // SMSified credentials. string userName = ""; string password = ""; string senderNumber = ""; // Create new HTTP request. string url = String.Format(webTarget, senderNumber); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] postData = Encoding.ASCII.GetBytes(String.Format(webPost, "14075551212", "This is a test from C#")); req.ContentLength = postData.Length; // Set HTTP authorization header. string authInfo = userName + ":" + password; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); req.Headers["Authorization"] = "Basic " + authInfo; // Send HTTP request. Stream PostStream = req.GetRequestStream(); PostStream.Write(postData, 0, postData.Length); HttpWebResponse res = (HttpWebResponse)req.GetResponse();
Keep in mind this is just a specific example using SMSified and others may vary.
A "Free" (but Limited) Option
Twilio offers a "Free Plan" that you may want to look into. I'm sure it has some limitations and restrictions and you would likely need to bump up to the larger packages if you needed such features depending on your usage :
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, April 23, 2014 9:07 AM -
User2103319870 posted
Hi,
Try using Twilio
Twilio libraries available for .NET: https://github.com/twilio/twilio-csharp
Sample Code
static void Main(string[] args) { TwilioRest.Account account; Hashtable h; // ACCOUNT_SID and ACCOUNT_TOKEN are from your Twilio account account = new TwilioRest.Account(ACCOUNT_SID, ACCOUNT_TOKEN); h = new Hashtable(); h.Add("From", CALLER_ID); h.Add("To", "PHONE NUMBER TO SEND TO"); h.Add("Body", "The answer is 42"); account.request(String.Format("/{0}/Accounts/{1}/SMS/Messages", API_VERSION, ACCOUNT_SID), "POST", h)); }
Also Check the below links- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, April 23, 2014 9:14 AM
All replies
-
User-760709272 posted
http://forums.asp.net/t/1459384.aspx?Sending+an+SMS+Message+with+ASP+NET
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, April 19, 2014 3:17 PM -
-
User281315223 posted
You'll likely need to use some type of service or SMS Gateway to handle sending SMS messages, which may not always be free (much like sending text messages or phone calls often aren't). The details and implementations may vary for each of them, but you will certainly need an active internet connection (which I am assuming they meant by the modem) to use them (as you would with any sort of web-based technology)
I'll list a few options for highly recommended SMS Gateways for .NET as well as the code for sending messages for one in particular.
Overview and Suggestions
I would recommend checking out the following Stack Overflow discussion on SMS Gateways, which recommended Clickatell. However, there are tons of them out there, so I would suggest doing some research and figuring out what works best for you :
- Twilio Cloud Communications - I've heard good recommendations for this one.
- MXTelecom
- RedOxygen SMS Gateway
- Intellisoft
- OpenMarket
- Panacea Mobile
Wikipedia also features a fairly comprehensive listing of SMS Gateways as well.
An Actual Example
You will need to use some type of service most likely to perform this, especialy if you are going to be performing it on a large scale.
SMSified appears to have quite an extensive and friendly API for performing this very task.
A fully featured example on sending outbound SMS messages using SMSified can be found here and seen below :
// SMSified API endpoint. string webTarget = "https://api.smsified.com/v1/smsmessaging/outbound/{0}/requests"; // Parameters to send with API request. string webPost = "address={0}&message={1}"; // SMSified credentials. string userName = ""; string password = ""; string senderNumber = ""; // Create new HTTP request. string url = String.Format(webTarget, senderNumber); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; byte[] postData = Encoding.ASCII.GetBytes(String.Format(webPost, "14075551212", "This is a test from C#")); req.ContentLength = postData.Length; // Set HTTP authorization header. string authInfo = userName + ":" + password; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); req.Headers["Authorization"] = "Basic " + authInfo; // Send HTTP request. Stream PostStream = req.GetRequestStream(); PostStream.Write(postData, 0, postData.Length); HttpWebResponse res = (HttpWebResponse)req.GetResponse();
Keep in mind this is just a specific example using SMSified and others may vary.
A "Free" (but Limited) Option
Twilio offers a "Free Plan" that you may want to look into. I'm sure it has some limitations and restrictions and you would likely need to bump up to the larger packages if you needed such features depending on your usage :
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, April 23, 2014 9:07 AM -
User2103319870 posted
Hi,
Try using Twilio
Twilio libraries available for .NET: https://github.com/twilio/twilio-csharp
Sample Code
static void Main(string[] args) { TwilioRest.Account account; Hashtable h; // ACCOUNT_SID and ACCOUNT_TOKEN are from your Twilio account account = new TwilioRest.Account(ACCOUNT_SID, ACCOUNT_TOKEN); h = new Hashtable(); h.Add("From", CALLER_ID); h.Add("To", "PHONE NUMBER TO SEND TO"); h.Add("Body", "The answer is 42"); account.request(String.Format("/{0}/Accounts/{1}/SMS/Messages", API_VERSION, ACCOUNT_SID), "POST", h)); }
Also Check the below links- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, April 23, 2014 9:14 AM -
User1088003863 posted
I'm not sure about it but my asp has done this for my websites that are providing service to send sms from computer. I'm using paid service to manage my SMS marketing campaigns and I'll update this thread after discussing this with my dev.
Monday, November 10, 2014 9:13 AM -
User-1349739621 posted
If You Want Send Sms On Mobile Phone What Ever You Store in Date Base You Have To Buy Active expert SOftware And You Can Mange With 2008 Web Server And You Can Send Sms On Multipal Number But You Need To have Gsm Modem or Mobile Phone That You Can Us As A Sms Sending Option
Sunday, December 7, 2014 5:41 PM