Skip to content

Instantly share code, notes, and snippets.

@erikgregorywebb
Last active May 13, 2021 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikgregorywebb/03c97b0b75044796c7bad34791357390 to your computer and use it in GitHub Desktop.
Save erikgregorywebb/03c97b0b75044796c7bad34791357390 to your computer and use it in GitHub Desktop.
from twilio.rest import Client
# create client
account_sid = 'YOUR-ACCOUNT-SID'
auth_token = 'YOUR-AUTH-TOKEN'
client = Client(account_sid, auth_token)
# define message function
def sendMessage(body, from_, to):
message = client.messages.create(body = body, from_ = from_, to = to)
# send message
body = 'Is this thing working?'
from_ = 'YOUR-TWILIO-PHONE-NUMBER'
to = 'YOUR-OWN-PHONE-NUMBER'
sendMessage(body, from_, to)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment