RATE THIS ANSWER
0
Click to Vote:
0
0
You sure can and it is similar to sending an email using a normal smtp:
<%
'##################################################
'# Requirements: dvmailer.dll
'##################################################
'##################################################
'# Set Global Variables
'##################################################
SMTP_SERVER = "mail.domain.com"
SMTP_SERVER_PORT = 25
'##################################################
'# Function to send the SMS via email
'#
'# Returns True/False whether the email was sent.
'##################################################
Public Function SendSMS(msgToEmailAddress, msgFromEmailAddress, msgSubject, msgText)
' Set the various lengths associated with each carrier
' AT&T
If (InStr(1, msgToEmailAddress, "mobile.att.net") > 1) Then
maxLength = 140
' Nextel
ElseIf (InStr(1, msgToEmailAddress, "messaging.nextel.com") > 1) Then
maxLength = 280
' Sprint PCS
ElseIf (InStr(1, msgToEmailAddress, "messaging.sprintpcs.com") > 1) Then
maxLength = 100
' Default Length
Else
maxLength = 140
End If
' Typically, there are at least two characters of delimiter between the from,
' subject, and text on the screen of the mobile device.
'We must add this into the equation in order to ensure
' the entire message gets sent to the device.
msgLength = len(msgFromEmailAddress & " " & msgSubject & " " & msgText)
' This is here to make sure the message isn't longer than the device supports.
If ( msgLength > maxLength) Then
' Return false
SendSMS = false
Else
' Create DevMailer Object
Set Mailer = CreateObject("Geocel.Mailer")
' Add SMTP server
Mailer.AddServer SMTP_SERVER, SMTP_SERVER_PORT
' Set From
Mailer.FromAddress = msgFromEmailAddress
' Set Subject
Mailer.Subject = msgSubject
' Set Content Type to Text Only
Mailer.ContentType = "text/plain; charset=us-ascii"
' Set the body
Mailer.Body = msgText
' Add recipient
Mailer.AddRecipient msgToEmailAddress, ""
' Send It
SendSMS = Mailer.Send()
End If
End Function
%>
The sendsms.asp will pull in this function and send off a text message.
<!--#include virtual="/sms.inc"-->
<%
msgTo = "3131234567@messaging.sprintpcs.com"
msgFrom = "joelauer@domain.com"
msgSubject = "Hello World"
msgText = "First text-message!!"
'Attempt to send the sms
IsSent = SendSMS(msgTo, msgFrom, msgSubject, msgText)
if IsSent then
Response.Write("SMS successfully sent to " & msgTo)
else
Response.Write("SMS not successfully sent to " & msgTo)
end if
%>
Last Answered:
Mar 20 2009 5:53 PM GMT by KarlG 
7305 pts.