Professional Documents
Culture Documents
articles quick answers discussions features community help Search for articles, questions, tips
this article allows you to send SMS to any mobile using GSM modem or your mobile connected via USB able to Computer
Introduction
This code provided allows to send SMS from the PC to any mobile with the help of GSM modem or any GSM compatible mobile.
Background
Basically I am making use of AT commands , which are AtTention Commands which are used for communication between the computer and the
modem.
Microsoft windows provides witha software called Hyperterminal which is available through thispath.
AT commands can be typed here. Hypertreminal communicates directly with the modem /mobile connected and instructs the modem. It also gives
responses back as OK or error etc. But if we have a application where we need to send SMS after a specific set of actions, then hypertreminal is not
useful, since it requiers manual typing. You need to select the COm port on which modem/mobile is connected.(port can be serial port for modem
or USB port for mobile).
The code given does this.If any doubs are there you can contact me on the forum below
VB Shrink ▲
//
// if COM3 is shown in device manager then put COM4 in foll statement
//
Dim SMSEngine As New SMSCOMMS("COM4")
SMSPort.WriteLine("AT")
'set command message format to text mode(1)
SMSPort.WriteLine("AT+CMGF=1" & vbCrLf)
'set service center address (which varies for service providers (idea, airtel))
SMSPort.WriteLine("AT+CSCA=""+919822078000""" & vbCrLf)
' enter the mobile number whom you want to send the SMS
SMSPort.WriteLine("AT+CMGS= + TextBox1.text + " & vbCrLf)
_ContSMS = False
SMSPort.WriteLine("+ TextBox1.text +" & vbCrLf & Chr(26)) 'SMS sending
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
End Sub
class SMSCOMMS is defined in the code. I have tried this code with only nokia mobiles like nokia 5310, nokia 3500 etc. ALso i have tried sending
sms from airtel provider to idea also. It works fine. Download the code. Its simple n explained with comments.
Points of Interest
Programming in mobile communication, serial port interfacing, TAPI programming in.net
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Written By
namrata khandeparkar
Software Developer (Junior)
India
hello . I am studying BE in information technology in GOA.
My interests lie in programming in mobile communication in vb.net etc.
Search Comments
Small project for Namrata (sms component) Member 11640868 24-Apr-15 22:26
I want same code in VB6. Can you give me ? Rahul Kanchan 17-Mar-15 17:13
nokia c2-02 & nokia 2700 classic Member 8060420 15-Dec-13 3:13
Last Visit: 27-Jun-23 10:17 Last Update: 28-Jun-23 8:53 Refresh 1 2 3 4 5 Next ᐅ
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.