Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending SMS Messages from ASP Form using Clickatell.com COM API

Posted on 2004-04-27
4
Medium Priority
?
878 Views
Last Modified: 2008-01-16
Hi all,

I am developing an application which allows users enter their sms number through the website.
In the admin section, i want to be able to send sms messages to one user or the entire list. My problem is getting to grips with connecting to the COM Object and the fact that VBScript is used, bit confused by it all. I have received a manual from Clickatell with all the Published COM Objects but cannot understand how to input them into the form. List is here: http://www.clickatell.com/downloads/Clickatell_com_2.2.1.pdf

I have created a simple form on a page called send_sms.asp:

<FORM action="sms_message_sent.asp" method=post>
<P ALIGN="CENTER">To:<INPUT name=to> <BR></P>
<P ALIGN="CENTER">Message:<TEXTAREA name=text ROWS="7"></TEXTAREA><BR> </P>
<P ALIGN="CENTER">From:<INPUT name=from>
<INPUT type=submit value=send></P>
</form>

The code for sms_message_sent.asp is here:

<%@ LANGUAGE="vbscript" %>
<% Option Explicit %>
<SCRIPT RUNAT=Server LANGUAGE="VBScript">
Sub Main
Dim CallInfo
Dim oSMS

Response.Write("Creating the SMS COM object<br>")
Set oSMS = Server.CreateObject("SMS_COMAPI.SMS")
 
Response.Write("Sending a simple SMS<br>")
 
CallInfo = oSMS.SendSimpleSMS(API_ID, "username", "password", Request.Form("to"), Request.Form("text"))
 
CallInfo = "SMS sending was done with result:" & CallInfo & "<br>"
Response.Write(CallInfo)
 
Set oSMS = Nothing
End Sub
</Script>
<html>
<head>
<title>SMS - Message Sent</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%
'----Start of send --------------------------------------
 Call Main()  
%>
</body>
</html>

My Question in brief is how to write all the COM Properties into the .asp page? An Example of the code would be very useful indeed.
0
Comment
Question by:fgict
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 10927696
Does what you have above send a message?
0
 
LVL 1

Author Comment

by:fgict
ID: 10928479
Yes,
If i hard code in my API_ID, Username & Password it sends a message.
The message doesn't show the "FROM" field if i place it after Request.Form("text") i get an error message.
I also need to add in other COM Properties such as message type, validity period, delivery time etc.
0
 
LVL 31

Accepted Solution

by:
alorentz earned 2000 total points
ID: 10928590
So what's the question then, it's all in the directions you have...
0
 
LVL 1

Author Comment

by:fgict
ID: 10928725
How do i put in the other COM properties?

Where do i place the "from" field in the sms_message_sent.asp to get back the sender address and where do the other properties go like:
smsVAL_PERIOD Data Type: long
smsDELIVERY_ACK Data Type: Boolean
smsMAX_CREDITS Data Type long
go?

The manual doesn't give me specific examples and i cannot figure out where to place these properties within the code cause the error messages aren't giving me back any real data?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question