|
Help for SMS-Maker Version 1.0
|
05/09/2003
|
6. Create SMS files with SMSMAKER.DLL |
SMSMAKER.DLL includes a simple, easy-to-use object class with properties and methods to create SMS files from
any other developing platform or Office application. It's mainly designed for developers who want to use SMS-Maker
with their own program or on their website to send SMS messages.
You can also modify most settings of the SMS-Maker application, for example activate or deactivate sending
of SMS messages, set the Service Center phone number or change the interval to check for new SMS files to
be send.
To use the SMSMaker library, create an instance of the SMSMaker object class SMSFile. In VB for example,
you can do that with the following code:
Dim SMSMaker
Set SMSMaker = CreateObject("SMSMaker.SMSFile")
|
In ASP, just use the same piece of code. The only difference is refering to the built-in ASP Server object:
Dim SMSMaker
Set SMSMaker = Server.CreateObject("SMSMaker.SMSFile")
|
To remove your object from memory after using it, just set it to nothing (same in VB and ASP):
For all subsequent properties and methods, I assume that you already created an instance of the SMSFile
class as shown above.
Property name: |
Version (read-only) |
Property description: |
Returns SMS-Maker's license version as a string ('Light' or 'Pro'). For
unregistered versions, this will return 'Eval'. |
Examples: |
in ASP:
Response.Write(SMSMaker.Version)
|
in VB:
|
|
Property name: |
maxJobs (read-only) |
Property description: |
Returns SMS-Maker's job limit. For unregistered version, this will return '1',
for a Pro Unlimited license, it'll be '101'. |
Examples: |
in ASP:
Response.Write(SMSMaker.maxJobs)
|
in VB:
|
|
Property name: |
AppPath (read-only) |
Property description: |
Returns the DLL's complete path. |
Examples: |
in ASP:
Response.Write(SMSMaker.AppPath)
|
in VB:
|
|
Property name: |
isRunning (read-only) |
Property description: |
Returns TRUE, if SMS-Maker is running on your machine or the remote
host, otherwise FALSE. The application writes an entry in the INI file when launched
and terminated. This way, the ActiveX component can determine if SMS-Maker is currently running.
|
Example: |
if SMSMaker.isRunning then
...
end if
|
|
|
Property name: |
RegisteredName (read-only) |
Property description: |
Returns the registrant's name. For the evaluation version, this
will return 'unregistered'. |
Example: |
MsgBox SMSMaker.RegisteredName
|
|
|
Property name: |
RegisteredEMail (read-only) |
Property description: |
Returns the registrant's eMail address. For the evaluation version,
this will return 'unregistered'. |
Example: |
Response.Write("If you have problems sending SMS messages," & _
"contact us at " & SMSMaker.RegisteredName)
|
|
|
Property name: |
ExpirationDate (read-only) |
Property description: |
Returns the expiration date of SMS-Maker. For unregistered versions,
this will return 12/31/2010. |
Example: |
Debug.Print SMSMaker.ExpirationDate
|
|
|
Property name: |
RegistrationDate (read-only) |
Property description: |
Returns the date when your license for SMS-Maker was issued. For unregistered
versions, this will return the current date. |
Example: |
Debug.Print SMSMaker.RegistrationDate
|
|
|
Property name: |
INI |
Property description: |
Returns or sets the INI file the DLL uses to read and save program settings.
This is useful, if the DLL is saved in a different folder (or on a different computer) than
the application. By changing this, you can point the DLL to the INI file the program is using
and change the settings. For changing this value, use a complete local or UNC path. |
Example: |
SMSMaker.INI = "C:\Programs\SMSMaker\SMSMaker.ini"
Response.Write(SMSMaker.INI)
|
|
|
Property name: |
OutgoingDirectory |
Property description: |
Returns or sets the outgoing directory. In this directory all SMS files will be
saved and the application will check this folder and send all files found here. Use complete
local or UNC path to change it. |
Example: |
SMSMaker.OutgoingDirectory = "\\Server\C$\Programs\SMSMaker\Out"
Response.Write(SMSMaker.OutgoingDirectory)
|
|
|
Property name: |
isSending |
Property description: |
This property returns or sets the status of the application concerning automatic SMS sending.
Return values are 'TRUE' for sending is active (application is checking the outgoing directory
for new SMS messages to be send) or 'FALSE'.
To set this value, use '1' for activating, and '0' for deactivating SMS transactions. |
Example: |
X = SMSMaker.isSending
SMSMaker.isSending = 1
|
|
|
Property name: |
Port |
Property description: |
Returns or sets the COM port the application will use for connecting to the cellphone. |
Example: |
Response.write(SMSMaker.Port)
SMSMaker.Port = 2
|
|
|
Property name: |
Speed |
Property description: |
Sets or returns the baudrate used by the application to talk to the connected cellphone.
To set this value, use only standard baudrates (2400, 4800, 9600, 14400, 19200, 38400, 57600). |
Example: |
MsgBox SMSMaker.Speed
SMSMaker.Speed = 19200
|
|
|
Property name: |
ServiceCenter |
Property description: |
Returns or sets the phone number of the provider's service center. Use
international format or local number with leading 0 (before area code), no dashes, spaces or
(back)slashes. |
Example: |
SMSMaker.ServiceCenter = "+49170760000"
Response.Write(SMSMaker.ServiceCenter)
|
|
|
Property name: |
addEmptySCNumber |
Property description: |
Some providers need a ’00’ instead of no service center number
(only in PDU mode). This property returns or sets, if an empty SC number is included in messages
or not. Use '1' to set it or '0' to ommit it. |
Example: |
If SMSMaker.addEmptySCNumber Then MsgBox "Empty No. will be send."
SMSMaker.addEmptySCNumber = 1
|
|
|
Property name: |
logSMS |
Property description: |
Returns or sets, if SMS transactions will be logged or not. Returns TRUE or FALSE.
Use '1' or '0' to set it. |
Example: |
Response.Write(SMSMaker.logSMS)
SMSMaker.logSMS = 0
|
|
|
Property name: |
OutTiming |
Property description: |
Returns or sets the interval for checking the outgoing SMS directory for new
messages (in seconds). |
Example: |
SMSMaker.OutTiming = 30
...
Response.Write("Message will be send in between the next " & _
SMSMaker.OutTiming & " seconds.")
|
|
|
Property name: |
isDebug (read-only) |
Property description: |
This will return TRUE if SMS-Maker runs in debug mode, otherwise FALSE. |
Example: |
Response.Write(SMSMaker.isDebug)
|
|
Method name: |
CreateSMS(strRcpNumber, strMessageText [, strSMSFileName], [intSRR], [intFlash])
|
Method description: |
This is the method you're looking for ;-)) It creates an SMS file in your outgoing folder.
|
Method parameters: |
STRING strRcpNumber: The recipient's phone number
STRING strMessageText: The text of your message (max. 160 Characters)
optional STRING strFileName: Name of SMS file to save the message to. If no name is given,
this method will create one from the date and time of the message. File extension must be .SMS,
if no filename is given, it will be added.
optional INTEGER intSRR : Request Status Report. Use 1 to request delivery confirmation
from the service center. If you use this parameter, strSMSFileName must be given, too.
optional INTEGER intFlash : Send as Flash (Alert) SMS. Use 1 to send a message that will
be immediately shown on the recipient's display. If you use this parameter, strSMSFileName
and intSRR must be given, too.
|
Return value: |
TRUE or FALSE. |
Examples: |
A = SMSMaker.CreateSMS("+491707331128", "This is a test")
B = SMSMaker.CreateSMS("+491707331128", "Another test", "test.sms")
C = SMSMaker.CreateSMS("+491707331128", "Will this work?", "",1)
D = SMSMaker.CreateSMS("+491707331128", "Happy Birthday", "",0, 1)
|
|
Method name: |
SaveChanges |
Method description: |
This method saves all changed settings. With this method, you can permanently
save any settings remotely from your application or web page. All changes will take effect
immediately in SMS-Maker application. If you make any changes while using an instance of the
SMSFile class and don't call this method, your changes will be lost after destroying it.
|
Method parameters: |
none |
Return value: |
none |
Example: |
Call SMSMaker.SaveChanges
|
|
Here's a description of the various error that may occur when using the ActiveX DLL, just in case
you want to do some error trapping in your own application and you want to know, what happened:
Err. No. |
Err. Message |
Err. description |
1 |
<INI file> not found |
The specified INI file for application and DLL was not found. It's
either not in the same directory as the DLL or you made a mistake when setting it. Check your
path and filename and set the property <obj>.INI again.
|
2 |
COM port not found |
The COM port is net set in the INI file. Use property <obj>.Portto set it. |
3 |
COM Speed not found |
There's no baudrate set in INI file. Use property <obj>.Speed to set it. |
200 |
No number: Recipient number is empty |
This happens if you want to create an SMS file and idn't supply a recipient number. |
201 |
No text: Message text is empty |
When saving an SMS file, you forgot to supply a message text. |
202 |
Invalid format: Recipient number must start with '+' or '0' |
The recipient's number format is wrong. You must use international
format, for example +491707331128 or local format with a leading zero, like 01707331128.
|
203 |
Invalid format: Recipient number can't contain spaces, dashes or (back)slashes |
The recipient's number format is wrong. Don't use spaces, dashes or slashes. |
204 |
Message too long: Max. 160 characters for text to be send |
The message text is too long, max. allowed is 160 characters. |
205 |
Wrong file extension: Use '.sms' only. |
The filename extension supplied is wrong. SMS-Maker accepts .sms only. |
206 |
File '...' already exists. |
The file SMS-Maker is about to create already exists. |
207 |
Can't create SMS-file '...'. Make sure the directory exists and you have the proper access rights |
SMS-Maker can't create a file because the outgoing directory doesn't exist or cannot be accessed. |
© Oliver Witte for
WAY-X GmbH,
2002-2003. All rights reserved, all wrongs reversed.
|