Java 从 Web 应用程序发送短信

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19373988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 16:33:03  来源:igfitidea点击:

Sending SMS from Web Application

javasms

提问by SpringLearner

I am developing a web application in which I need to SMS and Email.Sending Email can be easily done but I need help in sending SMS.So for a beginner who dont know even what API's are required to send SMS,what All are required to send SMS.I mean to

我正在开发一个 Web 应用程序,我需要在其中发送短信和电子邮件。发送电子邮件可以轻松完成,但我需要帮助发送短信。所以对于一个甚至不知道发送短信需要什么 API 的初学者来说,所有都需要什么发送短信。我的意思是

  • Is there any SMS gateway required?
  • Any requirement of server? I found some links likeand thisBut this are using some kind of dongle/GSM network.But suppose for a web application how to do this because I can not connect a USB dongle on client side.Any help is appreciated
  • 是否需要任何短信网关?
  • 对服务器有要求吗?我发现了一些链接喜欢这个但这正使用某种加密狗/ GSM network.But假设为Web应用程序如何做到这一点,因为我无法连接上的客户端side.Any帮助一个USB加密狗赞赏

回答by Thusitha Thilina Dayaratne

Having a gateway is not a must. If you don't have a gateway what you can do is use your mobile phone or dongle as a serial modem and send SMS through that.

拥有网关不是必须的。如果您没有网关,您可以做的是使用您的手机或加密狗作为串行调制解调器并通过它发送短信。

One of the most popular libraries that you can use is Ozeki. It includes an example code pack.

您可以使用的最受欢迎的库之一是Ozeki。它包括一个示例代码包。

回答by pappu_kutty

you can use smslib [1]: http://smslib.org/which is a library supports java .net through which you can use sms gateway like gateway modem, or you can use mobile (as sms gateway) to send sms and receive.

您可以使用 smslib [1]:http://smslib.org/这是一个支持 java .net 的库,您可以通过它使用像网关调制解调器这样的短信网关,或者您可以使用手机(作为短信网关)来发送和接收短信.

Personally i suggest you to development activity and testing, i did some research and conclude that once you move your application to production and connecting your mobile or sms modem is bit tedious as far as i know :), in this phase there are many online sms gateway providers based on your location who provides you an interface where you can send/receive message and it may cost you .

我个人建议您进行开发活动和测试,我做了一些研究并得出结论,一旦您将应用程序移至生产环境并连接您的手机或短信调制解调器,就我所知,这有点乏味:),在此阶段有许多在线短信网关提供商根据您的位置为您提供一个界面,您可以在其中发送/接收消息,这可能会花费您。

回答by Amith Koujalgi

If you need a free SMS gateway, there isn't one. No cellular network provider would want to expose free APIs and get themselves in trouble. You will have to go for paid services.

如果您需要一个免费的 SMS 网关,则没有。没有蜂窝网络提供商愿意公开免费的 API 并让自己陷入困境。您将不得不寻求付费服务。

回答by sikander

I will suggest that you should use JSMPP (git page). JSMPP is the Java implementation of SMPP (Short Message Peer-to-Peer). It provides the communication channel between your web application and the SMS service center. It supports upto 5000 SMSs per second. The SMS service center will charge you for the service but you can do as much testing as you want by using Selenium simulator. Both the JSMPP and Selenium simulator are free of cost.

我建议你应该使用 JSMPP ( git page)。JSMPP 是 SMPP(Short Message Peer-to-Peer)的 Java 实现。它提供了您的 Web 应用程序和 SMS 服务中心之间的通信通道。它每秒最多支持 5000 条短信。SMS 服务中心将向您收取服务费用,但您可以使用Selenium 模拟器进行尽可能多的测试 。JSMPP 和 Selenium 模拟器都是免费的。

回答by Ashhad

You can use SMSGateway.me, you have to download their android app on your phone which will act as sender, and from your web app you can schedule messages via REST API.

您可以使用SMSGateway.me,您必须在您的手机上下载他们的 android 应用程序,该应用程序将充当发件人,并且您可以从您的网络应用程序中通过 REST API 安排消息。