python发短信

1.注册twilio.com(或者其他sms gateway)
2.在dashborad面板上得到accountSID&authToken&twilioNumber
3.pip install twilio
4.code:

accountSID = ''
authToken=''
myNumber=''
twilioNumber=''
from twilio.rest import Client
def textmyself(mes):
    twilioCli = TwilioRestClient(accountSID,authToken)
    twilioCli.messages.create(body=message,from=twilioNumber,to=myNumber)
发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>