Last post Apr 10, 2010 07:27 AM by saajshek1
Aug 15, 2009 11:38 PM|vcsjones|LINK
Often times it may be a requirement for your web application to send an SMS message. Such examples would be reminders, password resetting, and spam.
Q: Can I have some code to send an SMS message?
A: Unfortunately it isn't as simple as just copying and pasting some code into your application and you can start blasting out text messages. SMS is a service, and cellular carriers will charge for it. The cost varies by carrier. SMS is a standard defined
set of protocols that is authenticated to. When you contact a cellular company they will provide you with a username, password, gateway (sometimes called an Endpoint), and various other protocol related configurations.
There are several existing .NET SMS SDKs out there - some are free and open source - but that doesn't change the fact that ultimately, those SDKs need endpoints configuration and you are back to the problem of needing a provider.
Q: OK - How do I get in touch with a company to send an SMS?
A: Most often than not it isn't feasible to contact a cellular company themselves. If you were to contact say, Verizon, you would only be able to send an SMS to Verizon phones. So you would have to partner with individual carriers - then there is the pain
of figuring out which number belongs to which carrier. The easiest solution is to go to a 3rd party company that handles all of the messy work for you. This gives you an advantage of sending them in a simple manner and also not needing to know or understand
how the SMPP protocol (or whatever protocol they are using - there are many) works as they will almost always provide an SDK or Web Service of their own.
Q: What 3rd party Gateway Provider should I use?
A: It varies by country, but a popular one that is somewhat regional is
Clickatell. (Disclaimer - I do not work for them nor have I used their services - I found them via Google). They also provide their own SDK with sample code.
Here is a list of other ones:
Q: I want a vanity or custom shortcode, like 134569 instead of a phone number.
A: That depends on the gateway provider. Clickatell allows you to rent one.
Q: We are going to be using A LOT of SMS messages - what if I want my own gateway?
A: If you want to setup your own gateway, then you will need some physical hardware are well as software.
Kannel is a popular open source SMS Gateway that runs on Unix like operating systems. You will still need to contact an SMS Center and this does not mean you can start sending out SMS messages for free.
Good luck with your application.
Aug 16, 2009 05:12 PM|tdinpsp|LINK
If I understand you correctly you want to send a SMS message to a phone. Provided that you know the carrier for that phone you can send it a message via email.
<asp:DropDownList ID="DDLCarrier" runat="server">
<asp:ListItem Value="@vmobl.com">Virgin Mobile</asp:ListItem>
So if the phone number was 999-999-9999 and the carrier was Verizon then you could simply email to firstname.lastname@example.org and the message will appear on the phone as a text message. So as long as you know the carrier of the phone number it will work. If
you don't know the carrier then I suppose you could send it to all the carriers and at least one should work.
Aug 16, 2009 06:53 PM|vcsjones|LINK
My post was a FAQ (Frequently asked Question) with a Q and A (Since it's in the FAQ Forum). I wasn't really looking for an answer, just writing a post that can help others.
Sep 18, 2009 03:59 AM|raghava.mrk|LINK
Thanks for posting this article.... It helps a lot for sending messages through asp.net pages
Sep 18, 2009 04:25 AMemail@example.com|LINK
hey.... Raghakrishna Raju.M
Buddy..I m new in asp.net and i need ur help regarding Sending SMS through Asp.net . I personally tried to work on Sms via Asp.net but could'nt get Success.. Will u please Paste ur code that u r using to Send SMS.. It would be Ur kind Aid to Me.. thanks
Sep 23, 2009 04:57 AM|Pushkar|LINK
Hello Sir Jones
Thank you very much for the nice information.
I didn't know how to send SMS in ASP.Net.
But after read your post, i got the idea.
Its really helpful
Sep 23, 2009 06:59 AM|Srinivas>bheemareddy|LINK
Good Info jones
Sep 26, 2009 07:53 AM|deboojk123|LINK
Actually, i'm having this problem of sending an automated sms from my asp.net (vb) website. I'm a student and presently designing a website for my final project. The project is an intelligent car rental system that include sending an sms notification to
rentals to remind them of when to return the car.
I've been in contact with clickatell for gateway but my problem is how to schedule the sms notification. Details of rental service will be stored in SQL database which includes the renter name, address, phone, rentdate and returningdate. So if returningdate
is tomorrow, then sms notification should be sent today as a reminder.
Oct 14, 2009 09:07 AM|realisticp|LINK
As I am one of the fresher asp.net developer ,get some usuful tips from here.
Oct 16, 2009 11:23 AM|Ramesh Bandi|LINK
I think I wasted so much of time on this topic but after having a look at your post I got complete idea of sending SMS through ASP.NET form.
Thanks for the post.
Nov 27, 2009 07:23 AM|linick|LINK
I don't know if this is a right place ask this question. But i need a solution as early as possible.
I am developing a web application, it includes sms sending facility.
As per your suggestion, i thought of implementing the same with clickatell. But i am not able open up the link given.
Did they change their site to a new address?
Nov 27, 2009 03:37 PM|vcsjones|LINK
As of just now, the ClickAttel link in my original post appears to still be working. Perhaps you hit it when they had some down time?
Dec 02, 2009 09:32 AM|hinaAsp.Net|LINK
Dec 02, 2009 11:34 AM|spiritssoft|LINK
For Send SMS Through Code:
Step 1: Add Web Reference :
Step 2: Add This "using com.spiritssoft.www;"
Step 3: Create a Object "SendWay2Sms smsobj = new SendWay2Sms();"
string strResult = smsobj.sendSmsSpiritsSoft("UserName", "Password", "Number", "message");
strResult : Recieving the Result from Webservice
- For Group SMS , Number seperated by commas(,).
- Message should be Only 125 characters,
- If No username , password form way2sms.com it will send message
through Spirits Soft Technology Default Number.
From : Spirits Soft Technology
SMS to All Over India
Dec 07, 2009 12:00 PM|kundasang|LINK
is it possible for other country?
Dec 15, 2009 08:19 AM|S.WAYEZ|LINK
I have written a blog on how to send sms thru asp.net in saudi arabia
Dec 16, 2009 10:14 AM|satalaj|LINK
Some ISP banned clickatell domain in India.
Refer my article on how to send sms using ASP.net and SMS api provider
Dec 16, 2009 06:59 PM|kanueishtiaq|LINK
I want to send SMS through my ASP .Net web site. I am attaching the code which I am using to send sms
protected override void Page_Load(object sender, System.EventArgs e)
string API = "http://www.way2sms.com/jsp/InstantSMS.jsp?UID=9996380898&PWD=password&MSG=Hello+yyy+zzz&MobileNumber=9996340998";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(API);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
Jan 06, 2010 09:38 AM|S.WAYEZ|LINK
Am facing a problem, whenever am sending a message from localhost it works, but whenever am trying to send from client
computer, it says unable to connect to remote server! am sending a message from sms provider website, so i have included the messaging and connecting string of that website in codebehind, am using vb.
what may be the isssue.?
.i checked internet is available on server and client
2.i checked that client has the permission to access server files
3. do we need to have any spl permissions to run scripts at server?
Jan 06, 2010 10:36 AM|satalaj|LINK
It ssems they are accessing networks via proxy? If yes then you need to add proxy settings in your code
while calling API.
Jan 08, 2010 06:19 AM|apkumar|LINK
Is this code working fine for you?
I didn't get messages using this code, while debugging it is showing done (for strResult) but not getting SMS.
Thanks & Regards,
Jan 25, 2010 02:28 PM|S.WAYEZ|LINK
Thnx for your reply! i even dont know how to add proxy settings to my code?
can you elobarate plz
Jan 25, 2010 02:48 PM|satalaj|LINK
you can refer the same code provided
you need to create instance of webProxy like this
// WebProxy proxy = new WebProxy("192.168.1.100",3321);
then tell your request object to use this proxy settings
//request.Proxy = proxy;
First makesure that you are accessing intenet via proxy server.
This way all requests going out from your pc will go through proxy server.
Also you can refer this post
Feb 07, 2010 05:24 AM|rami_nassar|LINK
actually, I think its more simple than that...
just find your suitable SMS provider company, then copy & paste their code templet with a few of configuration :)
Mar 14, 2010 11:36 AM|dumbre.akshay|LINK
Can we use free sms portals like way2sms.com; indyarocks.com or 160by2.com? Can we include its URL in our code, is it possible? send me mail your answer.
Apr 10, 2010 07:27 AM|saajshek1|LINK
I have got one ready made application which might be usefull for you.
The URL is http://www.codeproject.com/KB/aspnet/SendingSMS.aspx.
Its working fine . But test it once again.
If u got the right solution then plz dont forget to marked as answer