无法使用循环发送大量短信
我想使用 GSM 调制解调器从我的电脑发送短信。我已经使用了这个示例并且我可以发送短信。我想使用循环向许多用户发送短信,但它不起作用。
我的错误:
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)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对从电脑发送短信一无所知,但我有两个建议。
wait()
或sleep()
命令来绕过它。I don't know anything about sending SMSs from your PC, but I have two suggestions.
wait()
orsleep()
command in your loop to bypass it.我知道,这并不能真正回答您的问题,但我发现使用托管解决方案要容易得多。我使用的是clickatell,它非常便宜、简单且可靠。这样,您就不需要使用任何半成品短信 API(例如您正在使用的 API),也不需要任何额外的硬件,例如 GSM 调制解调器。唯一的缺点是,如果您的网络出现故障,您将无法发送短信。
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.