i do not need such a complex content or component.
i just need some simple code to send a SMS.... For example how to open the com port, set the AT command and so on......A very simple coding to send SMS.
thank you
Main Topics
Browse All TopicsIs there any guide for me?
i would like to send a SMS using a GSM modem in ASP.
code provided would be better
Can anyone help?
thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
On http://www.gsm-modem.de/gs
Regards
Meff
Dear Friend,
What all you know is great about At commands and MsComm in Vb or Asp all you need to do is open the Port for Mscomm when ur device si connected and write those specifiv at commands through them.
This is all you need to do for ASP.
for details regarding commands
http://www.agarwalandsons.
Regards
Vikas Agarwal
Dear,
What Vikas is trying to say is ...
you have to Develop one ActiveX component in VB , Which will open COM port to send AT Command for u...
this component can be eassly called by ur ASP page..
here is some lines of code in VB...
public Sub SendSMSMessage(String msg)
MSComm1.InputLen = 0
MSComm1.RThreshold = 5
MSComm1.CommPort = 3
MSComm1.InBufferCount = 0
MSComm1.PortOpen = True
MSComm1.Output = "AT + CMGF = 1" & vbCrLf
MSComm1.Output = "AT+CMGS=9872091812"
If MSComm1.InBufferCount Then
if(StrConv(MSComm1.Input, vbUnicode)=">") then
MSComm1.Output = Msg
end if
End If
End Sub
write this fucntion on Active DLL and create its object in ASP...
like:
ASP Page :VB Script
Set obj=Server.CreateObject("M
obj.SendSMSMessage "My First Message"
Look on other articals in this forum for more details..Like
vb code for 2 way messaging...
or
Search GOOGLE or other Searc engine for SMS Code in VB
Any code written in VB to send SMS can work for ASP also .. USE VB SCRIPT in ASP Page...
ok here are is some code which u can use in ASP page written in VB Script..
<%
Set obj=Server.CreateObject("M
MSComm1.InputLen = 0
MSComm1.RThreshold = 5
MSComm1.CommPort = 1
MSComm1.InBufferCount = 0
MSComm1.PortOpen = True
MSComm1.Output = "AT + CMGF = 1" & vbCrLf
MSComm1.Output = "AT+CMGS=9872091812"
If MSComm1.InBufferCount Then
if(StrConv(MSComm1.Input, vbUnicode)=">") then
MSComm1.Output = "My First Message"
end if
End If
End Sub
%>
Make one ASP ge , write above code in VB Script
Instead of "My First Message" String, u can take Request.Form("SMSMessage")
I don't know whether above AT Commands work with ur phone or not...
To Know abt AT comand See other Acrticals in this forum..
Look, no body can write a complete code u ....
To Set Service Center Number the Command is :its not required sometime, if mobile is already configured ...
"AT+CMCA=\"982345676\"\r"
To send SMS
First Send :
"AT+CMGF=1\r" //Command to Put the Mobile in Text Mode
then
"AT+CMGS=\"9872091812\"\r"
then in response u get
">"
then only u can send Text Message.... of 160 character...
Last character must be char(26)
is it ok ?....
Are u sure the line number is same where error is coming...
if yes, then check do u have mscomm32.ocx file in system32 directory..
then check if it is register properly or not in OLE view Tool comes with V.Studio ...or Find entry in registry of "MSCOMMLib.MSComm" or
"MSCOMMLib.MSComm.1"
u can register ur ocx file by running command in run window
Regsvr32 mscomm32.ocx
The MSComm control is a licensed product and is neither availabe on XP nor in ASP.
It is available in Professional Visual Basic 6.
There is an alternative FreeWare control at http://ourworld.compuserve
You'll still need the .ocx file though.
How to set the setting to 9600 baud, no parity, 8 data, and 1 stop bit.
Is it MSComm1.Settings = "9600,n,8,1"?
But my code cannot works.
<%
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>
<%
Dim MSComm1,strReceived
Set MSComm1=Server.CreateObjec
'MSComm1.Settings = 9600,n,8,1'
MSComm1.CommPort = 2
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.PortOpen = Not MSComm1.PortOpen
If MSComm1.PortOpen Then
response.write "Comm. Port " & MSComm1.CommPort & " Settings: " & MSComm1.Settings
Else
response.write "Comport Problem "
End If
MSComm1.Output = "AT+CMGF=1" & vbCrLf
Delay(0.2)
MSComm1.Output = "AT+CSCA=+6596845997" ' Set GSM service centre no. '
Delay(0.2)
MSComm1.Output = "AT+CMGS=98157058" 'phone number'
Delay(0.2)
MSComm1.Output = "Hello this is a test. pls reply if u recieve this message.Thanks" + Chr(26)
Delay(2)
%>
U must me passing worng argument to 'StrConv' , this fucntion need string to convert it to other format(like Lower case upppercase,SimplifiedChine
Secondly, easy way to set the com port setting is just don't touch the setting properties of MSCOMM, rather go to Device Manager and select com port and change the desire setting ,
ur Setting strings looks ok , ... it should be like that only...
Hi babsjid
In order to send SMSs from your web application you can follow the approach discussed befor for classic asp.
but you will need to make some modifications ..like : u will not need to use Server.CreateObject("MSCOM
instead .. u will add a refrerence to the COM component called [Microsoft Comm Control] after that u will have the MSCommLib in the references node at the solution explorer
now u can put a button on the WebForm and write this code :-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MSComm1 As New MSCommLib.MSCommClass
Dim strReceived As String
MSComm1.Settings = "9600,n,8,1"
MSComm1.CommPort = 2
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.PortOpen = Not MSComm1.PortOpen
If MSComm1.PortOpen Then
Response.Write("Comm. Port " & MSComm1.CommPort & " Settings: " & MSComm1.Settings)
Else
Response.Write("Comport Problem ")
End If
MSComm1.Output = "AT+CMGF=1" & vbCrLf
Threading.Thread.Sleep(200
MSComm1.Output = "AT+CSCA=+6596845997" ' Set GSM service centre no. '
Threading.Thread.Sleep(200
MSComm1.Output = "AT+CMGS=98157058" 'phone number'
Threading.Thread.Sleep(200
MSComm1.Output = "Hello this is a test. pls reply if u recieve this message.Thanks" + Chr(26)
Threading.Thread.Sleep(200
End Sub
insure that the serial parameters are correct for ur configuration like the comPort number and the supported message format
I can be of help if u need more
Business Accounts
Answer for Membership
by: MeffPosted on 2004-01-21 at 12:01:47ID: 10168128
On http://www.visualtron.com/ download.h tm you may will find the answer to your question.
API downloads for VisualGSM Enterprise
Code for sending SMS
From DOS command-line
Java class code
PHP code
ASP code (download free HTTP component)
DirectSQL execution
ASP/VB/Delphi/C++ code (download free ActiveX HTTP component)
Regards
Meff
www.gsm-modem.de