Twilio 发送短信

示例

要使用Twilio和Python发送您的第一条SMS,您只需要Twilio-Python帮助程序库即可开始。

# Download the twilio-python library from http://twilio.com/docs/libraries
fromtwilio.restimport TwilioRestClient
 
# Find these values at https://twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
client = TwilioRestClient(account_sid, auth_token)
 
message = client.messages.create(to="+12316851234", from_="TWILIO_NUMBER",
                                 body="Hello there, StackOverflow!")