#首先,在这个网站注册账户。 https://www.twilio.com/,申请手机号码的方法在此省略。 请用百度确认
#! /usr/超级列车/python
#-* -编码: utf-8-* -
#文件名: twilio_phone.py
from twilio.rest import *
“”'
发送邮件
account=' AC 7635 b 9970-------- -可通过注册账号信息查看
token='B19C------------'
client=client (
message=client.messages.create (to=' 8615900000000 ),from_=' 17200000000 ),
body='Hello there!' )
“”'
打电话
def call_phone () :
account=' AC 7635 b 9970------------ "
token='B19C------------'
client=client (
call=client.calls.create (to=' 861590000000 ',# to是电话接受者
from_=' 17200000000 ',# from是twilio申请的手机号码
URL=' http://twimlets.com/hold music? bucket=com.twilio.music.ambient ' )