php 从我的网站发送短信(只发送不接收)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6438984/
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-26 00:23:50  来源:igfitidea点击:

Send sms from my website (only send not receive)

phpsmssms-gatewaybulksms

提问by yuvraj

I want to send sms to a group of phone numbers in my database, from my website. Can you please guide me how to do it, which are the best and reliable sms api in php which I can integrate? Is it possible to send sms free or with low cost? I want to sent sms only in India, if anyone has experience in this please do reply thanks in advance.

我想从我的网站向我数据库中的一组电话号码发送短信。你能指导我怎么做吗,我可以集成的 php 中最好、最可靠的 sms api 是什么?是否可以免费或以低成本发送短信?我只想在印度发送短信,如果有人有这方面的经验,请提前回复谢谢。

回答by Bad Programmer

Answer 1: This is a pretty nice sms API: http://www.clockworksms.com/

答案 1:这是一个非常好的 sms API:http: //www.clockworksms.com/

Answer 2: This isn't an API solution, but more of an overview how you can quite easily build your own solution with PHP5. To send an sms to a phone, all you have to do is email the message to the phone number. The email address is just the phone number and carrier domain.

回答 2:这不是一个 API 解决方案,而是更多地概述了如何使用 PHP5 轻松构建自己的解决方案。要将短信发送到手机,您所要做的就是将消息通过电子邮件发送到电话号码。电子邮件地址只是电话号码和运营商域。

  1. Determine Carrier
  2. Determine domain for carrier
  3. Construct email address
  4. Send email
  1. 确定运营商
  2. 确定运营商的域
  3. 构建电子邮件地址
  4. 发电子邮件

Determine CarrierThe carrier can be determined by the area code and first 3 numbers. I don't know any APIs off the top of my head (I'm sure they exists though), but if you wanted to go the custom route you can sort of build your own. For example, this site has an input where you can determine carreir: http://www.telcodata.us/search-area-code-exchange-detail

确定运营商 运营商可以通过区号和前 3 个数字来确定。我不知道有任何 API 是我的头脑(尽管我确定它们存在),但是如果您想走自定义路线,您可以构建自己的路线。例如,此站点有一个输入,您可以在其中确定 Carreir:http: //www.telcodata.us/search-area-code-exchange-detail

But it's just posting the data, so you can figure it out by passing your own parameters. for example: ww.telcodata.us/search-area-code-exchange-detail?npa=323&exchange=249

但它只是发布数据,因此您可以通过传递自己的参数来弄清楚。例如:ww.telcodata.us/search-area-code-exchange-detail?npa=323&exchange=249

Determine DomainEach carrier has their own domain for text. For example, AT&T is @txt.att.net while Verizon is @vtext.com.

确定域每个运营商都有自己的文本域。例如,AT&T 是@txt.att.net,而Verizon 是@vtext.com。

Here is a list of carrier domains: http://www.emailtextmessages.com/

以下是运营商域名列表:http: //www.emailtextmessages.com/

Construct EmailExample: if an AT&T number is (510) 123-4567 you can send an sms to the number by emailing [email protected].

构建电子邮件示例:如果 AT&T 号码是 (510) 123-4567,您可以通过发送电子邮件至 [email protected] 向该号码发送短信。