从网站向用户发送短信 - 如何?

发布于 2024-10-08 16:27:26 字数 170 浏览 15 评论 0原文

我的网站上有电子邮件通知,但我也想添加短信通知。我不知道该怎么做。是纯粹的编码还是我需要与世界各地的电话提供商建立合作伙伴关系或购买服务或其工作原理。对于编码,是否有我可以使用或必须从头开始的框架?我的社交网络是用 php 和 mysql 编写的。为此,我是否需要数据库中的任何内容,例如存储消息,还是这一切都在 ISP 端?

I have email notifications on my site but I want to add SMS notifications also. I am lost how to do this. Is it purely coding or do i need to engage in partnerships with phone providers world over or buy a service or how does it work. And for the coding are there frameworks i can use or have to do it from ground up? My social network is in php and mysql. Do i need anything from the database for this, like to store the messages or is that all on the ISP's end?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

浮生未歇 2024-10-15 16:27:26

您需要为此提供服务,或者建立自己的基础设施(GSM 调制解调器等)。最好使用短信聚合器,例如 Clickatel。这种服务的技术术语是“短信网关”。

无论您选择哪个网关,您都需要找出他们的 API 是什么并使用它来发送短信。

You need either a service for that, or to set up your own infrastructure (GSM modem, etc.). Best go with an SMS Aggregator, such as Clickatel. The technical term for this kind of service is "SMS Gateway".

Whichever gateway you choose, you need to find out what their API is and use it to send SMS.

南渊 2024-10-15 16:27:26

我推荐 Twilio。我用它们为我开发的农业遥测监控应用程序发送短信和合成语音通知,根据我的经验,他们以非常合理的价格提供出色的服务。 (如果我听起来像个骗子,那么我并不是——只是一个快乐的客户。)

至于集成,他们有一个基于 REST 的 API,可以很容易地从 PHP 中使用。我认为他们甚至有一个 PHP 库,尽管我自己没有使用过。

I recommend Twilio. I used them to send SMS and synthesized voice notifications for an agricultural telemetry monitoring application I developed, and in my experience they have a fantastic service at a very reasonable price. (If I sound like a shill, I'm not -- just a happy customer.)

As for integration, they have a REST-based API that's easily used from PHP. I think they even have a PHP library, although I haven't used it myself.

梦境 2024-10-15 16:27:26

您需要注册 SMS 网关。那里有很多短信网关提供商。您需要编写代码来发送短信,这与您编写的发送电子邮件的代码非常相似。幸运的是,您可以重复使用其他人为此编写的代码。

我在使用 Clickatell 作为短信网关方面有很好的经验,他们有用于发送短信的代码,可用于多种语言,包括 php。
您不需要在数据库中存储任何内容,即发即忘。

祝你好运 :)

You need to sign up to a SMS gateway. There are very many SMS gateway providers out there. You need to write code to send the SMS, quite similar to the code you write for sending e-mails. Fortunately you can re-use code written by others for this.

I have good experience using Clickatell as SMS gateway and they have code for sending sms ready for several languages including php.
You do not need to store anything in your database, fire and forget.

Good luck :)

瀟灑尐姊 2024-10-15 16:27:26

Many telephone companies also operate free email-to-SMS gateways; for example, T-Mobile has it setup where you can send to [email protected] to send an SMS/MMS message. Of course, it is less efficient and also requires that you know about all the gateways out there (and keep them up-to-date as possible, of course). However, it's an option if you have only a small number of users, and/or a large number of users that are on a small number of separate networks.

千と千尋 2024-10-15 16:27:26

在您的网站或博客中添加短信功能时,您有两个主要选择。 1. 基于云的 SMS 网关 2. 基于软件的 SMS 网关

告知初始设置 设置服务所需的成本和时间,基于云的解决方案更可取,因为它们的受欢迎程度意味着有很多人使用该服务并在他们的论坛上提供地狱 - 通常只需一点 html 知识,您就可以在几个小时内启动并运行

以下网站有一些关于该主题的有用信息,并且还为网站管理员提供免费的国际 SMS 小部件,以便将 SMS 添加到他们的网站或博客

http://xboxpcpro.co.uk/how-to-add-sms-to-website/

You have two main options when it comes to adding SMS functionality t your website or blog. 1. Cloud based SMS gateways 2. Software based SMS gateways

Informs of initial setup Costs and time required to set up the service, cloud based solutions are preferable as their popularity means there are many who use the service and provide hell on their forums - normally only a little knowledge of html you could be up and runing within a few hours

The following website has some useful info on the subject and also provides a free international SMS widget for webmasters to add SMS to their websites or blogs

http://xboxpcpro.co.uk/how-to-add-sms-to-website/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文