Python: 利用Twilio给自己手机发送短信

时间:2020-04-30 10:25:14   收藏:0   阅读:59

引言

Twilio账号相关

from twilio.rest import Client

# 定义短信sid  把网址内的ACCOUNT SID填入
account_sid = ‘*********************‘
# 定义密钥   把网址内的AUTH TOKEN填入
auto_token = ‘**********************‘

# 定义客户端对象  传入 sid  token
clinet = Client(account_sid, auto_token)

# 定义短信内容 1发给谁 2发信人 3短信内容
status = clinet.messages.create(to=‘+86***********‘,
                                from_=‘+************‘,
                                body=‘hello world‘)
print(status)

参考资料

[1] 拿来就能用!Python 每天定时发送一句情话 | 原力计划
[2] 利用twilio进行手机短信验证
[3] 避坑:twilio+python+电话现在不可以使用(大陆)

原文:https://www.cnblogs.com/shiwanghualuo/p/12806507.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!