Android Question Send SMS Problem

domcoz

Member
Licensed User
Longtime User
I have this Code:

.....
Dim SmsOk As PhoneSms
Dim i As Int

Pb.Progress = 0

For i = 1 To 10
Dim cells() As String
cells = List1.get(i)

Pb.Progress = i/List1.Size * 100

txtNominativo.Text = cells(0) & " Cell. (" & cells(1) & ")"

'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1
SmsOk.Send(cells(1),txtMSG.Text & "(" & i & ")") ' <- Op 2

Wait(200)

Log(cells(1) & " -- " & txtMSG.Text & "(" & i & ")")
DoEvents
Next

....

No send all 10 sms es. send 1,2,3,4,5,6,10 non send 7,8,9

I try with Op 1 and Op 2

Thanks
Domenico
 

Troberg

Well-Known Member
Licensed User
Longtime User
My guess: You are sending them too fast, and something gets choked. Just for testing, try to wait longer, say, 60 seconds, between each SMS. If that works, you know the cause, and can start trying to find the sweet spot for the waiting time.

Also, if they contain the same text, consider trying to send it as one SMS with multiple recipients.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
Or, even better, use Send2, which gives you an event when a message is sent. THat way, you can tick out the messages at an optimum pace.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
I see you have commented the right line: 'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1 (why)?
as Troberg advised, un-comment that and set the return value to true, instead of false.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
I see you have commented the right line: 'SmsOk.Send2(cells(1),txtMSG.Text & "(" & i & ")",False,False) '<- Op 1 (why)?
as Troberg advised, un-comment that and set the return value to true, instead of false.

And then change the logic to an event based one. Just add the messages to a list, and on each event, send the next one in the list and remove it from the list.
 
Upvote 0

domcoz

Member
Licensed User
Longtime User
Thanks,

My goal and send the usual message to a set of contacts, for example birthday wishes or other. There is commented because i try both solution but I lost some sms.

Now I try change parameter false to true.

Domenico
 
Upvote 0
G

GCOINC

Guest
FYI most providers have a 100 msg/per hr max, exceeding the provider limit throws a 'flag' to the provider for that device...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…