PYTHON: SENDING SMS AND MMS MESSAGES WITH TWILIO


SUBMITTED BY: inzi

DATE: March 31, 2017, 10:51 a.m.

FORMAT: Python

SIZE: 628 Bytes

HITS: 516

  1. PYTHON: SENDING SMS AND MMS MESSAGES WITH TWILIO
  2. twilio-python helper library makes this extremely easy. Open a file called send_sms.py and add the following lines:
  3. # /usr/bin/env python
  4. # Download the twilio-python library from http://twilio.com/docs/libraries
  5. from twilio.rest import TwilioRestClient
  6. # Find these values at https://twilio.com/user/account
  7. account_sid = "ACXXXXXXXXXXXXXXXXX"
  8. auth_token = "YYYYYYYYYYYYYYYYYY"
  9. client = TwilioRestClient(account_sid, auth_token)
  10. message = client.messages.create(to="+12316851234", from_="+15555555555",
  11. body="Hello there!")

comments powered by Disqus