Resources » .NET programming » .NET Framework

Sending SMS from C# application


Posted Date: 26-Feb-2007  Last Updated:   Category: .NET Framework    
Author: Member Level: Gold    Points: 10


Ever since my article(http://support.microsoft.com/kb/555578) published in MS Support site, I receive many emails seeking for clarifiations on how to send SMS from a computer. I am writing this article, a different of its kind, is in the form of Question and Answers, would serve for other readers also. It is based on a email conversation between me and one of the readers of the MS site article.



Question



The code sample you used with sms.dll in the article does not work with my ASP.NET mobile application. Why?

Answer



The article focuses on sending SMS from .NET CF application(used in Pocket PCs and Smart Phones). It also has a notion about ASP.NET mobile application that uses an existing webservice to send sms. Do not get confused with these two types of application. The article no way connected to sending SMS from any normal windows/console application in VB.NET or C#.

Question:



I am making a desktop software for this(phone Call or SMS) in VB.NET can you tell me how I call SMS.dll file and phone.dll file. Because without this when i am sending SMS it shows an exception ( value cannot be null. Parameter name: destination). So please tell me how i overcome with this problem, please tell me how i call SMS.dll or phone.dll.

Answer:



Those DLLs are found in Windows Mobile 5.0 SDK. You need to install them separately. .Net Compact Framework doesn't include those files. If you want to send sms from simple VB.NET(C#) application, you need to target your application to the device, not the computer at all. Ironically, this part is not the scope of that article.

For download details of Windows Mobile 5.0 sdk for Pocket PC, visit

http://www.microsoft.com/downloads/details.aspx?familyid=83A52AF2-F524-4EC5-9155-717CBE5D25ED&displaylang=en

For download details of Windows Mobile 5.0 sdk for Smart Phone, visit

http://www.microsoft.com/downloads/details.aspx?familyid=DC6C00CB-738A-4B97-8910-5CD29AB5F8D9&displaylang=en

Question



Then, how do I send SMS from my computer, not using .NET Compact Framework, not using smart device application template in Visual Studio.

Answer



To perform mobile operations, your computer must have wireless network (usually it requires a infra-red port) and must have SIM card attached either in CPU or in the modem. Only then, you can send SMS directly from computer to mobile. If you have Bluetooth capability in your system, you can send mails to mobiles which are Bluetooth enabled. These techniques are expensive and require a special configuration in the hardware, drivers and software.

The simplest way of sending SMS is using internet as a medium. You can make use of existing web services (they have SMS servers and gateways installed in their machines) as mentioned in my article.

Another way is to make use of existing messenger services like yahoo messenger. Get the messenger SDK and write program sending SMS using the components available. Using this technique, you can send SMS over the net, if you just have your own email account with them.

Question



Which SIM card I attach in CPU or in modem, it is mobile SIM card Or Any other thing because if I attach mobile phone SIM card then my every SMS is cost effecting so there is no difference in making a software or using simple mobile for send SMS.

Answer



The idea is to make the computer aware of mobile network and capable of handling wireless requests. You need a SIM card, subscribed to some mobile operator, not for a hand-held mobile, but for a computer.

But, the most common practice is to buy a USB (universal serial bus) SIM reader and SIM reader driver software from the mobile operator (Airtel, Reliance etc.) for use on a computer. The USB SIM reader is a PC/SC standard compliant reader so it is accessible using the Microsoft* smart card subsystem.

Moreover, nowadays, the question is not about making just software, but for which device? Where do you target your application to run? - is the biggest question prevailing today.


Question:



If I make my this software in asp.net + vb.net or c# after that it requires wireless network or not, if required then how I make a Wireless Network and what are their requirements if you have any tutorials about this. Please suggest me.

Answer:



Before writing drivers for WLAN, you first need a Wireless LAN card, the one like Intel PRO/Wireless 3945ABG.

To learn more about WLANS, you need to buy a book titled 'Designing a Wireless Network' by Syngress publications. Here is the URL:

http://books.google.co.in/books?id=2-AI80unEcoC&dq=list+of+WLAN+networks&pg=PA142&ots=KTuYF2zS6s&sig=tIi8O3wPgh2Tod6zrf1NNGWk_T4&prev=http://www.google.co.in/search%3Fhl%3Den%26q%3Dlist%2Bof%2BWLAN%2Bnetworks%26meta%3D&sa=X&oi=print&ct=result&cd=2



Question



If I made this software and install in client machine so I will work or not if not then why.

Answer




If you develop an application relying on these hardware/drivers/wireless protocols, your client should have the same infrastructure as well. No doubt about it.

Question



My requirements for this software is sending SMS and making phone calls to mobile phones or landline phones in free of cost.


Answer



If you are looking for sending SMS and making phone calls free of cost, it indirectly tells you that you need to spend for that. Anyways, there are some workarounds.

To make phone calls, You need to check with the services offered by

http://voice.yahoo.com

and

http://www.ehow.com/how_10209_make-phone-calls.html

.

From your .Net Application, you have to install RTC Client API and SIP(Session Initiation Protocol) Service Provider

The Real-Time Communications (RTC) Client API is a set of COM interfaces that enables you to build applications for making PC-PC, PC-phone, or phone-phone calls or creating instant messaging (IM) sessions over the Internet. Both voice and video calls can be established on PC-PC calls.


There are three simple steps in creating an Interop Assembly for the RTC Client SDK binaries. The Interop assembly can be used by C# or VB.NET managed code. I have assumed that you have installed the RTC Client API SDK 1.3

(1) Download and install the Microsoft Platform SDK

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/default.htm

(2) Generate the type library

"midl /I "C:\Program Files\Microsoft Platform SDK\Include" rtccore.idl"

(3) Generate the interop assembly for any version of the .NET framework

"tlbimp rtccore.tlb /out:Interop.RTCCore.dll /namespace:RTCCore /sysarray"

SIP Service providers are just like mobile operators, and you need to subscribe it.

Question



My above questions arises because when we are using yahoo messenger or any other messenger and make phone calls or sending SMS so for this our PC have no wireless network but our operations working properly.

Answer



The best and proven way is to make use of messenger services. It is simple as it is based on Internet. Get started with downloading the SDK and program against it.


Did you like this resource? Share it with your friends and show your love!

Responses to "Sending SMS from C# application"
Author: T.Thirumala Reddy    18 Jan 2009Member Level: Bronze   Points : 0
very valuble information....


Author: Dhanish Sudarsanan Nair    22 Jan 2009Member Level: Gold   Points : 1
Thanks for the details I never think of doing an sms based program after seeing your article I planned to do and is working fine


Author: Gollapudi Ramya Krishna    22 Jan 2009Member Level: Silver   Points : 0
valuable inforamtion given


thanks

ramya



Author: Balint    17 Feb 2009Member Level: Bronze   Points : 0
Where is the article?


Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    John Bhatt
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India