如何从 Java 发送短信?

发布于 2024-07-13 19:01:26 字数 1435 浏览 8 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

橘虞初梦 2024-07-20 19:01:26

需要浏览的网址很少,

http://opensmpp.logica.com/

http://smslib.org/

我推荐 SMSLIB

Few URLS to go through,

http://opensmpp.logica.com/

http://smslib.org/

I recommend SMSLIB

智商已欠费 2024-07-20 19:01:26

实现此目的的最佳方法是使用 SMS 网关。 SMS 网关一方面封装了与 SMS 承载介质接口的技术细节,另一方面它为应用层协议(如 http、SMTP、ftp 等)提供了与其交互的接口。 例如,您可以让一个 Web 应用程序通过 HTTP 与 SMS 网关通信,而另一端的网关将通过某种专有协议与 SMS 中心通信,以发送从应用程序收到的 SMS 文本。 此外,您还可以将网关配置为将传入的 SMS 消息发布回您的 Web 应用程序。 这样,应用程序不需要知道发送 SMS 的低层协议。

如果您需要批量发送短信,可以向短信中心(SMSC)租用一条线路,并将您的短信网关配置为使用该专线发送短信。 但租用一条线路要贵得多。 如果您需要发送少量消息,那么您可以使用手机代替专线。 将您的手机连接到您的 PC/服务器并配置网关以使用您的手机。 您需要参阅有关将手机与网关连接的网关文档。 这不是很困难,而是相当简单。

市场上有很多商业网关可供使用。 但使用开源短信网关是一个不错的选择。 您可以使用名为 - Kannel 的开源网关。 相信我,设置并开始使用并不困难。

The best way to achieve this is to use an SMS gateway. An SMS gateway encapsulates the technicalities of interfacing with SMS carrier medium on one hand and on other hand it provides an interface for application level protocols like http, SMTP, ftp etc. to interact with it. For example, you can have a web application talking to the SMS Gateway over HTTP and the gateway on its other side will talk to the SMS centre over some proprietory protocol to send the SMS text received from the application. Also, you can configure your Gateway to post the incoming SMS messages back to your web application. This way, the application need not know the low level protocols to send the SMSs.

You can lease a line to an SMS center (SMSC) if you need to send large number of bulk SMSs and configure your SMS gateway to use this lease line to send the msgs. But leasing a line is far more expensive. If you need to send small number of messages, then you can use your mobile phone in place of the leased line. Attach your mobile phone to your PC/Server and configure the Gateway to use your phone. You need to refer to your gateway documentation on interfacing your phone with the gateway. This is not very difficult but fairly simple.

There are lot of commercial gateways available in the market which can be used. But using an open source SMS gateway is a good option. You can use an open source gateway called - Kannel. Believe me, it is not very difficult to set it up and start using.

束缚m 2024-07-20 19:01:26

ESendex 这样的人可以提供这样的功能,并且还为您提供多种语言的 SDK/示例代码(包括Java)。

People like ESendex can provide functionality like this, and also give you SDKs/example code for many languages (including Java).

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