从 PHP 发送短信
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1939689/
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
Sending SMS from PHP
提问by Palanisami
How to send an SMS from a web server written in PHP?
如何从用 PHP 编写的 Web 服务器发送短信?
采纳答案by Daniel Vassallo
Clickatellis a popular SMS gateway. It works in 200+ countries.
Clickatell是一种流行的 SMS 网关。它适用于 200 多个国家/地区。
Their API offers a choice of connection options via: HTTP/S, SMPP, SMTP, FTP, XML, SOAP. Any of these options can be used from php.
他们的 API 通过以下方式提供连接选项的选择:HTTP/S、SMPP、SMTP、FTP、XML、SOAP。这些选项中的任何一个都可以从 php 中使用。
The HTTP/S method is as simple as this:
HTTP/S 方法就像这样简单:
http://api.clickatell.com/http/sendmsg?to=NUMBER&msg=Message+Body+Here(Clickatell API Guide)
http://api.clickatell.com/http/sendmsg?to=NUMBER&msg=Message+Body+Here( Clickatell API 指南)
The SMTP method consists of sending a plain-text e-mail to: [email protected], with the following body:
SMTP 方法包括将纯文本电子邮件发送到:[email protected],具有以下正文:
user: xxxxx
password: xxxxx
api_id: xxxxx
to: 448311234567
text: Meet me at home
You can also test the gateway (incoming and outgoing) for free from your browser: "Test SMS Gateway".
您还可以从浏览器免费测试网关(传入和传出):“测试 SMS 网关”。
回答by Elzo Valugi
PHP by itself has no SMS module or functions and doesn't allow you to send SMS.
PHP 本身没有 SMS 模块或功能,并且不允许您发送 SMS。
SMS ( Short Messaging System) is a GSM technology an you need a GSM provider that will provide this service for you and may have an PHP API implementation for it.
SMS(短信系统)是一种 GSM 技术,您需要一个 GSM 提供商来为您提供这项服务,并且可能有一个 PHP API 实现。
Usually people in telecom business use Asteriskto handle calls and sms programming.
通常电信业务的人使用Asterisk来处理电话和短信编程。

