Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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 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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

10 Experts available now in Live!

Get 1:1 Help Now