神奇的短信_CodingPark编程公园

文章介绍

本文主要讲述如何利用Python向自己或他人发送短信

try:
    from twilio.rest import Client
    account_sid = 'AC4255a1ab82ae-----e7b41b2f87e0'
    auth_token = '2862b219003-----f7e4a9e'
    client = Client(account_sid,auth_token)
    message = client.messages.create(to="+861580--132",from_="120293--830",body="This is a SMS")
    print('SMS Success!')

except Exception as e:
    print(f'Failed! reason:{e}')

在这里插入图片描述

原创文章 35 获赞 22 访问量 2993

猜你喜欢

转载自blog.csdn.net/weixin_38411989/article/details/106049164