ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / SMS functions
  • Managing errors
  • Differences between GO mode and run time
  • Required permissions
  • Folder of SMSs sent
  • SMS sent by the user
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Sends an SMS. The characteristics of this SMS have been specified in the SMS structure.
New in version 25
Android To send SMS messages with an attachment, use SMSRunApp.
Example
// Initialize the SMS structure for a standard number
SMS.Number = "0610203040"
SMS.Message = "I am sending SMSs with WINDEV Mobile!"

// Send the SMS
ResSend is boolean = SMSSend()

// Error occurred?
IF ResSend = False THEN
Error(ErrorInfo(errMessage))
END
// Initialize the SMS structure for a short number
SMS.Number = "3040"
SMS.Message = "I am sending SMSs with WINDEV Mobile!"
SMS.NumberType = smsNationalNumber

// Send the SMS
ResSend is boolean = SMSSend()

// Error occurred?
IF ResSend = False THEN
Error(ErrorInfo(errMessage))
END
Syntax
<Result> = SMSSend()
<Result>: Boolean
  • True if the SMS was sent,
  • False otherwise. To find out the error details, use ErrorInfo associated with the errMessage constant.
AndroidAndroid Widget If SMSSend is run in the main application thread, an hourglass (infinite progress bar) will be displayed when the message is sent. To specify the message that will be displayed in the hourglass, use NextTitle just before the call to SMSSend.
Remarks

Managing errors

SMSSend generates an error in the following cases:
  • the recipient number is invalid,
  • the message to send is too long,
  • the SMS center is overloaded.
  • ...

Differences between GO mode and run time

In GO mode (simulation on the development computer), a WLanguage error is generated during the call to SMSSend.
The differences between GO mode (simulator) and real use are presented in Differences between GO mode and real use.
AndroidAndroid Widget The SMS functions can be used during a GO on the Android emulator. To simulate the sending of SMS messages to the emulator, see the documentation of the Android SDK : https://developer.android.com/studio/run/emulator#console
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: SEND_SMS
AndroidAndroid Widget

Folder of SMSs sent

The sms/sent folder that can be found on some Android devices is not automatically filled when an SMS is sent.
AndroidAndroid Widget

SMS sent by the user

If the SMS must be actually sent by the user from the native application of the device (Android or iPhone/iPad), use SMSRunApp.
Related Examples:
Pocket Managing Contacts Mobile (WINDEV Mobile): Pocket Managing Contacts
[ + ] This example presents the management of contacts in Pocket PC.
The following topics will be presented in this example:
1/ the loopers
2/ the use of queries
3/ sending SMSs
4/ sending emails
5/ the phone call.
PC Sending SMS Mobile Windows (WINDEV Mobile): PC Sending SMS
[ + ] This example is used to create SMSs on a computer and to transfer them to a Pocket PC or to a Smartphone equipped with a SIM card in order to send them.
To use the PC Sending SMSs example, the Pocket Sending SMSs example must be installed on the Pocket PC or on the Smartphone.
A synchronization can be performed when the application is started to check whether SMSs must be sent or not.
Pocket Sending SMS Mobile Windows (WINDEV Mobile): Pocket Sending SMS
[ + ] This example is used to send SMSs created from the PC Sending SMSs example.
You also have the ability to write and send SMSs from the Pocket application.
How do I send an SMS from a Pocket PC or from a Smartphone with WINDEV Mobile?
All you have to do is use the SMS.XXX variables and the function named SMSSend():
  SMS.Message = "This is an SMS"
  SMS.Number  = "0612345678"
  SMSSend()
Component : wp250com.dll
Minimum version required
  • Version 9
Comments
Links SMS Short Number example
http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/536-envio-sms-pelo-windev-mobile/read.awp

http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/754-trabalhando-com-httprequest-com-exemplos-que-usam-curl/read.awp

http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/829-api-para-enviar-sms-com-garantia-entrega-short/read.awp

http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/1239-enviar-arquivo-json-por-rest-para-webservice-sms/read.awp
BOLLER
29 Sep. 2016

Last update: 05/26/2020

Send a report | Local help