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.
Who is Participating?
Olaf DoschkeConnect With a Mentor Software 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"
      loHTTPRequest = Createobject("MSXML2.XMLHTTP.6.0")
      loHTTPRequest = Createobject("MSXML2.XMLHTTP.3.0")

   lcText = URLEncode(tcText)
   lcParam = "userId="+lcUser +"&password="+lcPassword+"&to="+tcTo+"&body="+lcText
   Do While loHttpRequest.readyState <> 4
   ? loHttpRequest.status
   ? loHttpRequest.statustext
   Return loHttpRequest.responseText

Function URLEncode(tcString)
   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

b001Author Commented:
Thanks Olaf_Doschke
This works brilliantly.

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

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.


Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
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.

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.