Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP to send SMS

Status
Not open for further replies.

heyhey84

Programmer
Aug 31, 2003
16
SG
This is my code
I do not get a error msg, but my sms is not send out.
can anyone help?

<%

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,Buffer
Set MSComm1=Server.CreateObject(&quot;MSCOMMLib.MSComm&quot;)

MSComm1.Settings = 9600
MSComm1.CommPort = 2
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1



MSComm1.PortOpen = Not MSComm1.PortOpen

If MSComm1.PortOpen Then

response.write &quot;Comm. Port &quot; & MSComm1.CommPort & &quot; Settings: &quot; & MSComm1.Settings

Else
response.write &quot;Comport Problem &quot;
End If


MSComm1.Output = &quot;AT+CMGF=1&quot; & vbCrLf
Delay(0.2)
Buffer = MSComm1.Input
MSComm1.Output = &quot;AT+CSCA=+6596845997&quot; ' Set GSM service centre no. '
Delay(0.2)
Buffer = MSComm1.Input
MSComm1.Output = &quot;AT+CMGS=97665234&quot; 'phone number'
Delay(0.2)
Buffer = MSComm1.Input
MSComm1.Output = &quot;Hello this is a test. pls reply if u recieve this message.Thanks&quot; + Chr(26)
Delay(2)
Buffer = MSComm1.Input
MSComm1.Output = Buffer
%>
 
It's actually much easier to send them if you rely on the SMTP-SMS gateways that nearly every provider implements. Using those gateways you can send a message simply by using the CDONTS or CDOSYS object to send an email to a correctly formatted address. Generally providers have an address for these messages to be sent to and specify (in the US at least) that the number should be entered as a 10 digit number @ such-and0such-address.

Response time using these gateways has improved quite a bit, to the point now where I can send a message to either of my phones and receive it in less than 5 seconds (sprint and cingular). I don't have a link handy, but there are a few sites out there that will list 30 or 40 gateway addresses.

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top