vfp9 send sms message

Hi Experts

I would like to send SMS from vfp9 programe.
I found
Bulletin Solutions on line to buy the service and they give the following to code use.

// Using the org.apache.commons.httpclient library
String target = "https://www.bulletinmessenger.net/api/3/sms/out";
PostMethod postMethod = new PostMethod(target);

postMethod.addParameter("userId", username);
postMethod.addParameter("password", pwd);
postMethod.addParameter("to", dest);
postMethod.addParameter("body", msg);

// Send the message!
new HttpClient().executeMethod(postMethod);

I do not know how to use or convert this code to vfp code

Please help.
b001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Olaf DoschkeSoftware DeveloperCommented:
You don't need the org.apache.commons.httpclient library to make a post request. Aside of that they offer many APIs.

? SendSMS("64222222221","test+this")

Function SendSMS(tcTo, tcText)
   Local loHTTPRequest, lcUser, lcPassword, lcTet, lcParam

   lcUser     = "yourusername"
   lcPassword = "yourpassword"
   Try
      loHTTPRequest = Createobject("MSXML2.XMLHTTP.6.0")
   Catch
      loHTTPRequest = Createobject("MSXML2.XMLHTTP.3.0")
   Endtry

   lcText = URLEncode(tcText)
   lcParam = "userId="+lcUser +"&password="+lcPassword+"&to="+tcTo+"&body="+lcText
   
   loHTTPRequest.Open("POST","https://www.bulletinmessenger.net/api/3/sms/out?"+lcParam)
   loHTTPRequest.send(.NULL.)
   Do While loHttpRequest.readyState <> 4
      Doevents
   EndDo 
   ? loHttpRequest.status
   ? loHttpRequest.statustext
   Return loHttpRequest.responseText

Function URLEncode(tcString)
   #DEFINE ICU_BROWSER_MODE 0x2000000
   
   Local lcBuffer, lcResult, lnLength
   lnLength = 3*Len(tcString)
   lcBuffer = Space(lnLength)
   
   lnResult = InternetCanonicalizeUrl(tcString, @lcBuffer,@lnLength,ICU_BROWSER_MODE )
   Return Left(lcBuffer,lnLength)
   
Function InternetCanonicalizeUrl(lpszUrl, lpszBuffer,lpdwBufferLength,dwFlags)
   Declare Integer InternetCanonicalizeUrl In wininet;
      STRING    lpszUrl,;
      STRING  @ lpszBuffer,;
      INTEGER @ lpdwBufferLength,;
      INTEGER   dwFlags
   Return InternetCanonicalizeUrl(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
b001Author Commented:
Thanks Olaf_Doschke
This works brilliantly.

Is it possible to send sms using my own phone through bluetooth  ?

Thanks
0
Kalpesh ChhatralaSoftware ConsultantCommented:
You can use if your phone has COM Port Functionality or you can use any GSM Modem to Send SMS like normal mobile sms.

you can use AT Command to send SMS From Mobile/GSM Modem.

check below link for SMS using Mobile.

http://www.foxite.com/archives/how-can-i-send-sms-by-vfp6-0000066718.htm


-Kalpesh
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Olaf DoschkeSoftware DeveloperCommented:
Really? Wouldn't you simply send an SMS from your phone without going through bluetooth and your computer?

The bluetooth connection is merely for loading files to or from the phone, isn't it? Or to use internet connection.

What are you capable to program for your phone? What phone is it? Is it a legacy cell phone, or rather a smartphone? Is it iOS, Android or something else?

Simply look at https://www.bulletin.net/docs/display/API/Bulletin+API+-+HTML+Send+Tutorial
You can write a html file with this instruction and use it on your smartphone, it only needs a browser.

As said, they offer many ways, just take your time and look around.

Bye, Olaf.
0
b001Author Commented:
Hi Olaf_Doschke
I am trying to write a small project where when a job is completed my customer can send a message to their customer automatically confirming that job is completed.
So when the invoice is printed it will send SMS to the customer.

Thanks
0
Olaf DoschkeSoftware DeveloperCommented:
That's fine, but doesn't help me to help you about doing that from the phone instead of from a pc.

You can't run a foxpro app on any phone, the whole application would have to be written for phones to be able to use it from there.

Bye, Olaf.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.