Twilio Send messages in Python Sending messages and MMS through Twilio


Twilio help build apps that communicate with everyone in the world. Voice & Video, Messaging and Authentication APIs for every application.

You can get an API key for free.

To send a message through Twilio, your application needs to make an HTTP POST request to Twilio with the following things:

  1. The phone number you want to send the message to.
  2. Twilio number from which you’re attempting to send the message. (Only Twilio message-enabled phone numbers will work)
  3. The body of the message.

To send an SMS, make an HTTP POST request to the Messages resource.


Below is an example code to show how sending messeges with Twilio API will work.

# Download the twilio-python library from
from import TwilioRestClient

# Find these values at
client      = TwilioRestClient(account_sid, auth_token)

message = client.messages.create(
    to    = "+12316851234",
    from_ = "+15555555555",
    body  = "Hello there!"

If the Twilio number supports MMS, then you can send and receive MMS also.

Below is code to send MMS through Twilio API.

message = client.messages.create(
    to    = "+12316851234",
    from_ = "+15555555555",
    body  = "Hello there!",