Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Usman Safdar
  Where is Usman Safdar?
 TS
 Pakistan
 Usman Safdar
 To: khubaib khalid
  Where is khubaib khalid?
 HaroonAbad
 Pakistan
 khubaib khalid
 Tags
Subject: RE: sms api
Thread ID: 416073 Message ID: 416099 # Views: 64 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Sunday, December 21, 2014 4:34:05 PM         
   


> I get codes form Foxite, and try to send message with api
> message send successfully
> but have two problem
> 1:after sending 1 message i need to close application then again i am able to send.
> 2: if i select more than one mobile number, then only one message send.
>
>
>
> select mes
> ccnum=phone1
> 
>  lcTempTxtFilex =thisform.message.Value 
> 
> 
> DECLARE LONG URLDownloadToFile IN URLMON.DLL LONG, STRING, STRING, LONG, LONG
> lcTempTxtFile=lcTempTxtFilex
> websitename="http://bsms.ufone.com/bsms_app4/sendapi.jsp?id=011111111&message=&lcTempTxtFile&shortcode=fox&lang=English&mobilenum=&ccnum&password=12345&groupname=groupname"
>  lcGetURl = websitename
> lcTempTxtFile="thisform.message.Value"
> vresult = URLDownloadToFile(0, lcGetURl, lcTempTxtFile, 0, 0)
> If vresult # 0
> MESSAGEBOX("Problem Occured,So Message is not send",0)
> ELSE
> MESSAGEBOX("Message Successfully Send")
> Endif
> endscan
> 
> 


Please try this.(not tested)

LOCAL objXmlHttpMain,sURL
sURL="http://bsms.ufone.com/bsms_app4/sendapi.jsp?id=011111111&message=&lcTempTxtFile&shortcode=fox&lang=English&mobilenum=&ccnum&password=12345&groupname=groupname"
?send_sms(surl)
RETURN

*----------------------------------------------------------------------*
FUNCTION send_sms
*----------------------------------------------------------------------*
Lparameters lcurl
Local objXML As Microsoft.XMLHTTP
Local lcRetVal
lcRetVal = ""
Try
objXML = Createobject("Microsoft.XMLHTTP")
objXML.Open("GET", lcurl, .F.)
objXML.setRequestHeader("Content-Type", "text/urlencoded")
objXML.Send()
If (objXML.Status = 404)
lcRetVal = "404 Error"
Else
lcRetVal = objXML.ResponseText
Endif
objXML = Null
Catch To oErr
lcRetVal = "ERROR: "+oErr.Message
Endtry
Return lcRetVal
ENDIF

ENTIRE THREAD

sms api Posted by khubaib khalid @ 12/20/2014 5:18:24 PM
RE: sms api Posted by Usman Safdar @ 12/21/2014 4:34:05 PM
RE: sms api Posted by khubaib khalid @ 12/21/2014 6:34:38 PM