Solved

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

Posted on 2004-04-27
4
875 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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