Solved

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

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

Suggested Solutions

Title # Comments Views Activity
Select case on click 3 31
Hide Table in merge 3 53
Date on a table 16 46
GitHub 1 39
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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