SendSMS Control Documentation

Release 22 April 2002
Wise Advanced Solutions


Index:

1. Requirements

2. Instalation

3. Valid Originator Characters

4. Valid Message Characters

5. Control Events

6. Control Properties

7. Control Functions

8. Error Codes


Using the SendSMS.OCX control

1. Requirements

In order to use the SendSMS control you must have Internet Explorer 5 or later and Visual Basic 5 or later.

2. Instalation

You must register the SendSMS.OCX to the windows registry before including the control to your projects.
To do that, follow the above simple steps:

  1. Copy the SendSMS.OCX in to your system folder (WINDOWS\SYSTEM).
  2. Open a Command Dialog (click the Start button at your windows desktop and select the Run option, type command and press Enter).
  3. Move to your windows system folder (e.g. type: CD C:\WINDOWS\SYSTEM) and type: regsvr32 sendsms.ocx
  4. If you will get a message like this "DllRegisterServer in SendSMS.ocx succeeded." then you are ready to use the control from your Visual Basic Projects.

If you wish to unregister the control, type: regsvr32 /u sendsms.ocx

 

3. Valid Originator Characters

User the ValidOriginator function to check if the value of the originator string contains non supported characters.
The originator must contain any of the above characters.

Symbols: @£$¥!#¤%&\'()*+./:;<=>?§
Numbers: 0 ... 9
Latin characters: A ... Z, a ... z


4. Valid Message Characters

You can check if the message contains non supported characters by using the ValidMessage function.
The message can contain any of the above characters.

Symbols: (space)@;:,.!?()'+=-*<>\"¤#§¦¥£$%&_/
Numbers: 0 ... 9
Latin characters: A ... Z, a ... z
Greek characters: Á ... Ù, á ... ù

(For compatibility reasons the Greek lower case characters are automaticaly converted to upper case.)


5. Control Events

Indicates the connection state when trying to send a message or getting the user credits.

Syntax:

private sub object_ConnectionStateChanged(ByVal State As SMSConnectionConstants)

The State variable contain one of the above constants:

SMS_ConnectionClosed The connection is closed
SMS_Connecting Opening connection with the server
SMS_ConnectionOpened

The connection with the server is open

SMS_SendingRequest Sending message or the credits request
SMS_WaitingForResponse Waiting for recponse from the server
SMS_ReceivingResult Getting the results of the last request
SMS_ConnectionError Could not complete the request because of an error

 

6. Control Properties

RemoteHost Property

Returns or sets the server url to connect to.

Syntax:

object.RemoteHost [= server_url ]

The default value of the RemoteHost property is the current url of our sms server "www.sendsms.biz".

 

UserName and UserPassword Properties (Required)

Returns or sets the user name and password of your SMS account you created at sendsms.biz

Syntax:

object.UserName [= user_name ] (string)
object.UserPassword [= user_password ] (string)

 

Originator Property (Required)

Returns or sets the name of the message originator.

Syntax:

object.Originator [= your_originator_name] (string)

Originator is the name that the recipients will see as the message sender. There are some limitations to the length of the originator string value.
The string must be:

11 characters length for alpharithmetic strings, or
16 characters length for numeric string (e.g. a mobile phone number)

If the originator is numeric, it will appear on the mobile recipient's phone number as an international-format dialing numbers (prefixed with a "+").

Use the ValidOriginator function to check if the originator string is valid.

 

ScheduleDate and ScheduleTime Properties

Returns or sets the date and time for the scheduled delivery of an SMS message.

Syntax:

object.ScheduleDate [= date_of_the_message_to_send] (date or string)
object.ScheduleTime [= time_of_the_message_to_send] (string)

To schedule a message in a specific date and time, you must set both ScheduleDate and ScheduleTime properties.
After sending the message, the values of ScheduleDate and ScheduleTime will be lost.

 

TestMode Property

Returns or sets the testing mode of the control.

Syntax:

object.TestMode [= true for testing, false for nornal] (boolean)

By setting this property to True, you can test your application without actualy sending the message. The SMS server will reply as if the message was sent but no credits will be billed to your account.


7. Control Functions

ValidOriginator Function

Syntax:

Result = ValidOriginator(Originator_string)

Returns False if the length of the originator string exceeds the normal length, or if the originator string contains invalid characters (view the Originator property and the Valid Originator Characters chapter for details).

 

ValidMessage Function

Syntax:

Result = ValidMessage(message_string)

Returns a long number if the message is valid (actually, the length of the message). If the message contains invalid characters, or it exeeds the maximum allowed length set by the GSM specifications, it returns the SMS_InvalidMessage error code (please view the Valid Message Characters chapter for more details). The length of the message string must be less than or equal to 160 characters.

ValidRecipients Function

Syntax:

Result = ValidRecipients(recipients_string)

Returns a long number representing the number of recipients contained in the recipient string. If the recipient list is empty or contains non numeric values, the result of the ValidRecipients function will be the SMS_InvalidRecipients error code.
The recipient string must contain the mobile numbers seperated by commas (",") or the newline character (vbNewLine constant).
The mobile numbers must be of the format:

Country Code Network Code (excluding leading 0) Handset Number

e.g.

30 932 XXXXXX

 

If you omit the country code, the default code for Greece (30) will be used.

 

AvailableCredits Function

Syntax:

Result = AvailableCredits

Returns a long number representing the number of available user credits.
Before sending a message, you can use this function in combination with the ValidRecipients function to check if the number of the message recipients does not exceed the credits available to your account.

 

SendMessage Function

Syntax:

Result = SendMessage(message_string, recipient_string, [originator_string], [flash])

The SendMessage function has these parts:

message_string A string representing the text of the message to send.
recipient_string A string representing the list of the recipients, seperated by commas or the newline character.
originator_string Optional. String expression representing the name of the message sender. If you omit this parameter, the default value of the originator will be the value of the Originator property.
flash Optional boolean. If the flash parameter is set to true, the message will be sent as a flash message (a flash message appears on the receipients handset as soon as it is received, without the need to press any keys on the handset)

If the result of the function is false, the message has been succesfully sent. In any other case the function will return an error code.

 

StillExecuting Function

Syndax:

Result = StillExecuting

Use this function to check if the AvailableCredits or the SendMessage functions are still executing.

 

8. Error Codes

This is the description of the error codes.

SMS_ServerNotSpecified The server URL was not specified by the RemoteHost property.
SMS_ConnectionError A connection with the server could not be established.
SMS_MessageSendError The message could not be sent due to an error.
SMS_InactiveAccount The account specified by the UserName and UserPassword properties is inactive.
SMS_InvalidUser The values of UserName and UserPassword properties are not correct.
SMS_NoCredits The credits available to the specified account are less that those required to send the message.
SMS_InvalidDate The values of the ScheduleDate or ScheduleTime properties are not correct.
SMS_InvalidMessage The message string is empty or contains invalid charaters, or the message exeeds the 160 characters limit of the GSM specifications.
SMS_InvalidRecipients The recipient list string is empty or contains non valid phone numbers.
SMS_InvalidOriginator The originator string is empty or more than 11 or 16 characters.
SMS_InvalidData The server could not execute the request because of incomplete request arguments.
SMS_NetworkError There was an error with the server connection.

 

Please check the Visual Basic example included. If you have any problems or any questions about the usage of the SendSMS, you can contact us at info@sendsms.biz or via our site www.sendsms.biz.