1、说明:
这个主意我还是看到一个公众号,然后有说可以发短信,然后就搜索了一下,确实有这些第三方平台,好像可以免费用一定次数,因为注册后送了15美元,我只是测试,目前还没有过多使用。
2、开始注册账号:
1、官网:https://www.twilio.com/
注册过程我直接截图,看图就懂了。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
输完账号和密码后,会弹出一个验证:(因为我刚刚注册成功了,现在找不到手机输入界面了,所以如果你看需要手机验证的界面。要输入手机账号,手机会收到验证码,然后才可以成功注册。)
如过遇到这种点击验证码,把动物的图像调正就行了。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
2、寻找python的使用案例demo
需要安装一个模块:
pip install twilio
代码案例:
https://www.twilio.com/docs/sms/quickstart/python
或者 https://www.twilio.com/docs/python/install
也可以直接使用我下面给你的:
https://www.twilio.com/console 访问这个出现下面你的sid\token\申请成功的手机号
{% image /imgs/20190812144758969.png '在这里插入图片描述' '' %}# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = '你自己的sid'
auth_token = '你注册成功之后的token'
client = Client(account_sid, auth_token)
message = client.messages.create(
body="你好,这是我的第一个测试短信",
from_='+自己申请的手机号',
to='+86自己需要接收短信的手机号(国内前面要带+86),不然报错'
)
print(message.sid)