无法使用循环发送大量短信

发布于 2024-08-10 20:38:10 字数 478 浏览 3 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等你爱我 2024-08-17 20:38:10

我对从电脑发送短信一无所知,但我有两个建议。

  1. 看起来连接仍然打开。在发送新短信之前尝试关闭并重新打开它?
  2. 如果这不起作用,它可能有一些锁定,以防止您向人们发送垃圾短信。尝试在循环中放入某种 wait()sleep() 命令来绕过它。

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.
赠我空喜 2024-08-17 20:38:10

我知道,这并不能真正回答您的问题,但我发现使用托管解决方案要容易得多。我使用的是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文