How can I send an SMS from Java? [closed]

2019-01-18 12:55发布

问题:

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?

回答1:

Few URLS to go through,

http://opensmpp.logica.com/

http://smslib.org/

I recommend 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.

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.



回答3:

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



标签: java sms send