码迷,mamicode.com
首页 > 编程语言 > 详细

python免费发送短信

时间:2019-01-04 17:20:15      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:end   twilio   .com   __name__   token   number   messages   ESS   div   

pip install twilio
from twilio.rest import Client

# Your Account SID from twilio.com/console
account_sid = "AC3xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Your Auth Token from twilio.com/console
auth_token  = "xxxxxxxxxxxxxxxxxxxxxxxxxx"


def send():
    client = Client(account_sid, auth_token)
    # Your new Phone Number is +16184000273
    message = client.messages.create(
        to="+8615112341234",
        from_="+16184000273",
        body="这是一条测试短信!")

    print(message.sid)

if __name__ == __main__:
    send()

 

python免费发送短信

标签:end   twilio   .com   __name__   token   number   messages   ESS   div   

原文地址:https://www.cnblogs.com/blog-rui/p/10220607.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!