如何从Java发送短信?

时间:2021-04-01 20:49:26

I wanted to send SMS to particular mobile from a Web application and receive his reply and view to a web application only. Is it possible to create using Java technology?

我想从Web应用程序向特定的移动设备发送短信,并仅接收他的回复并查看网络应用程序。是否可以使用Java技术创建?

3 个解决方案

#1


Few URLS to go through,

很少有URL可以通过,

http://opensmpp.logica.com/

http://smslib.org/

I recommend SMSLIB

我推荐SMSLIB

#2


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.

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

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.

如果您需要发送大量批量SMS并将SMS网关配置为使用此租用线来发送消息,则可以将线路租用到SMS中心(SMSC)。但租用线路要贵得多。如果您需要发送少量消息,则可以使用移动电话代替租用线路。将手机连接到PC /服务器并配置网关以使用手机。您需要参考有关将手机与网关连接的网关文档。这不是很困难,但相当简单。

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.

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

#3


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

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

#1


Few URLS to go through,

很少有URL可以通过,

http://opensmpp.logica.com/

http://smslib.org/

I recommend SMSLIB

我推荐SMSLIB

#2


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.

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

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.

如果您需要发送大量批量SMS并将SMS网关配置为使用此租用线来发送消息,则可以将线路租用到SMS中心(SMSC)。但租用线路要贵得多。如果您需要发送少量消息,则可以使用移动电话代替租用线路。将手机连接到PC /服务器并配置网关以使用手机。您需要参考有关将手机与网关连接的网关文档。这不是很困难,但相当简单。

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.

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

#3


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

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