这篇文章就当作闲时娱乐的小乐趣吧,即使不会Python,你也可以使用Python发短信
登陆官网,注册账号,验证手机。
https://www.twilio.com/
https://www.twilio.com/
获取完电话号码,我们需要查看用户ID和TOKEN,等下会使用到
安装Python3,并且安装库twilio,安装完成之后,修改下面一段代码,将需要替换的字段值进行替换
下面展示一些 `代码。
from twilio.rest import Client
# Your Account SID from twilio.com/console
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Your Auth Token from twilio.com/console
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
message = client.messages.create(
# 接收号码
to="+86***********",
# 发送号码,即刚才获取的免费号码
from_="+1**********",
# 发送内容
body="起床啦")
print(message.sid)
from twilio.rest import Client
# Your Account SID from twilio.com/console
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Your Auth Token from