Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 information …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now