tags:

views:

210

answers:

2

I want to send SMS from my PC using a GSM modem. I have used this example and I can send SMS. I want to use a loop to SMS to many users, but it doesn't work.

My error:

sms.SerialConnectionException: Port currently owned by SMSConnector
    at sms.SerialConnection.openConnection(SerialConnection.java:93)
    at sms.Sender.send(Sender.java:42)
    at sms.SMSClient.run(SMSClient.java:43)
    at java.lang.Thread.run(Thread.java:595)
+1  A: 

I don't know anything about sending SMSs from your PC, but I have two suggestions.

  1. It looks like the connection is still open. Try closing it and reopenning it before sending a new SMS?
  2. If that doesn't work, it might have some lock in place to prevent you from spamming people with SMSs. Try putting some sort of wait() or sleep() command in your loop to bypass it.
Mark
A: 

this doesn't really answer your question, i know, but i find using a hosted solution much easier. the one i use is clickatell which is pretty cheap, easy and reliable. this way, you don't need to use any half baked sms apis (such as the one you are using) and you don't need any extra hardware like a GSM modem. the only downside is that if your network goes down you can't send sms.

pstanton