如何通过手机浏览器发送短信
我正在寻找一种从移动浏览器发送短信的方法。目前我有一个链接:
<a href = 'some thing..'>Send SMS to Me</a>
这个想法是,如果用户点击上面的链接,一条短信会自动从用户的手机发送到我的手机。
注意:我尝试过 但它要求用户确认是否要发送短信。有人对此有什么想法吗?
I'm looking for a method to send an SMS from a mobile browser. Currently I have a link:
<a href = 'some thing..'>Send SMS to Me</a>
The idea is, if the user clicks on the above link, a SMS is automatically sent to my phone, from the user's phone.
Note : I had tried <a href = 'sms:9xxxxxx?body...'>
but its asks the user to confirm if they want to send an SMS. Does anyone have any ideas for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为在没有真正获得用户同意的情况下这是不可能的——想象一下一个解决方案,网站可以在没有客户端允许的情况下获取任何智能手机的电话号码?听起来像是恶意使用的良好开端。
除了构建一个网络应用程序(仍然需要手动插入他的电话号码)之外,您唯一的可能性就是接受这样一个事实:您遇到了为您(和其他人)的安全和隐私而设置的障碍。
I don't think its possible without actually getting the users consent - imagine a solution where a website could get the phonenumber of any smartphone without the client allowing it? Sounds like a great start for a malicious use.
Your only possibility, besides building a web app to which the still has to insert his phonenumber manually, is embracing the fact that you reached a barrier that has been put there for your (and everyone else's) security and privacy.
一种方法是,
Send SMS to Me
此 http 链接可能会发送到服务器以及该服务器 jsp 或 servlet应该将短信发送给您。One way of doing it is that,
<a href = 'localhost/sms'>Send SMS to Me</a>
this http link will probably send to the server and that server jsp or servlet should send the sms to you.锚链接中的 sms: 前缀可以导致手机自己的短信应用程序被激活,并且短信是从手机发送的提示,如您所说。
该方法意味着您可以提示用户从他们的号码向 HTML 中的前缀号码发送电子邮件。
另一种方法是提示用户在您的网站上输入他们的手机号码,然后将其提交到您的服务器,您可以使用短信网关向他们发送短信。
从您的问题中不清楚您希望消息从哪个方向流向或流向哪个方向,但是通过 SMS 网关从您的 Web 服务器发送 SMS 会得到更一致的结果,因为这样就不管它是什么类型的浏览器了。
The sms: prefix in an anchor link can lead to the mobile phone's own SMS application to be activated and the SMS is the prompted to be sent from their mobile phone, as you say.
That method means you could prompt the user to send an email FROM their number TO your prefixed number in your HTML.
The alternative is to prompt the user to enter their mobile number on your website and then submitting that to your server you could use an SMS Gateway to send an SMS to them.
It's not clear from your question which direction you want messages to flow from and to but you'd get a more consistent result from sending the SMS from your web server via an SMS Gateway because then it wouldn't matter what kind of browser it was.