-
Re: sending sms with listview and checkbox in listview
did u load the numbers in listbox ?
-
Re: sending sms with listview and checkbox in listview
yes i did name and number
-
Re: sending sms with listview and checkbox in listview
snd me ur frm , with changes i told u
-
Re: sending sms with listview and checkbox in listview
Code:
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & Text3 & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
this is the send code
tell me what to put
-
Re: sending sms with listview and checkbox in listview
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & liist1.text & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
list1.listindex=list1.listindex + val(1)
now put this code in snd button and first ur listbox should be named list1 and should be loading the numbers , and before click send u have to select the first number, remove any code done on list1
-
Re: sending sms with listview and checkbox in listview
Object not an array
i get error
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
yes its sending
Ok. Then iterate through the ListView and for those items that are being check marked, enclose the number in that row with "<TO>" tag and append it to the XML.
Try testing the function that I have given you:
vb Code:
Private Function getSelectedNums() As String
Dim temp As String
temp = ""
Dim i As Long
For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview
If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked
temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" '~~~ enclose the number in "<TO>" tags
End If
Next
getSelectedNums = temp '~~~ return it
End Function
So, in place of this line in your code:
Code:
lsXml = lsXml & "<TO>" & Text2 & "</TO>"
replace that line with this:
Code:
lsXml = lsXml & getSelectedNums()
Test it and let us know if the issue still persists. Also, post the code that you have tried too.
:wave:
-
Re: sending sms with listview and checkbox in listview
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
text3.text=list1.text
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & text3 & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
list1.listindex=list1.listindex + val(1)
try this
-
Re: sending sms with listview and checkbox in listview
it dosnt give me any error but also it dosnt send the sms
i replaced this sXml = lsXml & "<TO>" & Text2 & "</TO>"
with this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
but not sending the sms from listview
-
Re: sending sms with listview and checkbox in listview
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
it dosnt give me any error but also it dosnt send the sms
i replaced this sXml = lsXml & "<TO>" & Text2 & "</TO>"
with this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
but not sending the sms from listview
Replace it with this:
Code:
lsXml = lsXml & getSelectedNums()
In my previous post, there was a typo. The variable name should be "lsXML" and I used "sXML". Please correct that.
You should also have the function code(from my previous post) copied to your form. What we are doing above is, calling that function. Which will return the selected items in ListView(the mobile number actually) enclosed within "<TO>" tags, as a String.
:wave:
-
Re: sending sms with listview and checkbox in listview
like this you meen
lsXml = lsXml & "<TO>" & getSelectedNums() & "</TO>" or like this? sXml = lsXml & "<TO>" & getSelectedNums() & "</TO>"
still dosnt work
dosnt send sms
i added a listbox
and who ever i want to send sms i transfer him to the listbox and send
can you tell me what to write for the listbox?
i meen to send sms to the customers that in the listbox?
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
like this you meen
lsXml = lsXml & "<TO>" & getSelectedNums() & "</TO>" or like this? sXml = lsXml & "<TO>" & getSelectedNums() & "</TO>"
You still didn't get the idea ?
This is what we are trying to do:
Code:
....
<TO>mobile_number_1</TO>
<TO>mobile_number_2</TO>
<TO>mobile_number_3</TO>
<TO>mobile_number_4</TO>
...
So the function that I have posted generates a string like above with the mobile numbers of the selected items in ListView.
If you still didn't understand it, try adding a button and in it's click event, use the following line:
Code:
MsgBox getSelectedNums()
And see what is being displayed.
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
akhileshbc
You still didn't get the idea ?
This is what we are trying to do:
Code:
....
<TO>mobile_number_1</TO>
<TO>mobile_number_2</TO>
<TO>mobile_number_3</TO>
<TO>mobile_number_4</TO>
...
So the function that I have posted generates a string like above with the mobile numbers of the selected items in ListView.
If you still didn't understand it, try adding a button and in it's click event, use the following line:
Code:
<TO>MsgBox getSelectedNums()
And see what is being displayed.
:wave:
it show me the numbers from the listview but dosnt send any sms
-
Re: sending sms with listview and checkbox in listview
Code:
'~~~ Testing
Private Sub Command1_Click()
MsgBox getSelectedNums()
End Sub
-
Re: sending sms with listview and checkbox in listview
<TO>number1</TO>number2</To> this is what i get
-
Re: sending sms with listview and checkbox in listview
Code:
<TO>number1</TO><TO>number2</To>
Isn't it ?
What we have to do is, put this returned string in your XML code.
So, in your code, we could use it like this:
Code:
'.....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'....
The above will result in this:
Code:
'.....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>number1</TO><TO>number2</To>" '<--- this is what the function would return
lsXml = lsXml & "</DEST_LIST></BODY>"
'....
Thus, we only need to call that function only.
Hope it is clear now.
:wave:
-
Re: sending sms with listview and checkbox in listview
yeahhhhhhhhhhh
its workingggggg for the love of godddddddddddd
tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx :):):):):):)
you saved my lifeeeeee
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
i understand my friend and i did exactly what you said but it still dosnt send me the sms
When you tried multiple <TO> tags, you were able to send the SMS right ?
What the function does is the same. Loops through the ListView and generates the <TO> tags.
Do one thing, in your code, just before this line:
Code:
winObj.send (SendString)
place this line of code:
Check the content now printed in the Debug window and see whether the XML is correct. Check the "<TO>" part.
:wave:
-
Re: sending sms with listview and checkbox in listview
Quote:
Originally Posted by
salsa31
yeahhhhhhhhhhh
its workingggggg for the love of godddddddddddd
tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx :):):):):):)
you saved my lifeeeeee
You are welcome :wave:
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
my friend 1 little question
i talked to the company of the sms
and i buy from them 1000 sms for customers.
now the deal is that i need to open an acount for each customer to give him the sms he is paying for
lets say danny buy from me 200 sms
how do i use vb 6 in my project to connect to the web system with his user name and password
and that he can use the 200 sms and not the 1000 that i buy
how do i limit him?
the company told me that in the code of the sending there is a function like this.
can you help me with that?
i saw now that i can limit him in the acount that i have in the sms company
but how i make it connect from the code to the web and verify name and password?
your are a genius by the way
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
Go through the manual. And open a new thread regarding any doubt if you have with that.
But first go through the manual that the company had given you. If you didn't understand it. Read it 3 or 4 times. Still if you can't figure it out, create a thread in here.
:wave:
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
thanks akhileshbc
for explaining what i was trying to show him
and even wrote a little code for him to try ;)
and salsa i guess your not fired anymore?
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
Quote:
Originally Posted by
Max187Boucher
thanks akhileshbc
for explaining what i was trying to show him
and even wrote a little code for him to try ;)
welcome :)
:wave:
-
Re: [RESOLVED] sending sms with listview and checkbox in listview
Quote:
Originally Posted by
Max187Boucher
thanks akhileshbc
for explaining what i was trying to show him
and even wrote a little code for him to try ;)
and salsa i guess your not fired anymore?
tnx to akhileshbc for solving and helped me.
this form and the giftit people here never let me down.
:thumb::thumb::thumb::thumb::thumb::thumb: