• +33 1 41 31 82 82
  • This email address is being protected from spambots. You need JavaScript enabled to view it.

How to send a SMS using PowerBuilder

"...here is the code to send sms through PB application .... but before you execute the code, make it sure that your GSM modem or Mobile set (which can be act as GSM modem) attached to the PC is working and installed properly...."

Check out other options for sending a SMS in French at Donf!

 Code: pb
integer li_FileNum
string mobileNumber
string Smsmessage
string comPort
string szEnd
string szCommand

mobilenumber = txtmobilenumber.text
Smsmessage = txtmessage.text
comPort = txtComPort.text
szEnd = char(26)

li_FileNum = FileOpen(comPort, TextMode!,Write!,LockWrite!,Append!)
if li_FileNum > 0 then 
  FileWriteEx(li_FileNum, "AT+CMGF=1")
  FileWriteEx(li_FileNum, "~n~r")
  szCommand = "AT+CMGS="
  szCommand += "~""+mobilenumber+"~""
  FileWriteEx(li_FileNum, szCommand)
  FileWriteEx(li_FileNum, "~r")
  FileWriteEx(li_FileNum, Smsmessage)
  FileWriteEx(li_FileNum, szEnd)
  FileClose(li_FileNum)
  MessageBox("Sms Application" , "Sms sent successfully....")
  txtmobilenumber.text = ""
  txtmessage.text = ""
else
  MessageBox("Sms Application" , "Unable to open comport....")
end if

 


Code Analysis

Explore & Understand complex code Evaluate the impact of a change. Improve PB and Database Code.


Learn More

Visual Guard

Application Security

Control Access to Sensitive Data.
Monitor Audit application Security.
Send notifications on suspicious events.

Learn More

AscentialTest Automated Software Testing

Automated Testing

The ONLY testing tool fully supporting
PowerBuilder Datawindows and Objects.

Learn More

© 2024 Novalys. All Rights Reserved.