Send SMS updates to mobile phone using python

In this tutorial, we are going to learn how to send SMS in Python. We will be using Twilio for sending SMS.

First of all, go the Twilio and create an account. You will get free trial account. And finish settings.

We have to install a module called twilio to work with Twilio client. Install it with the following command.

pip install twilio

Now, go to the Twilio Documentation on how to send SMS using Twilio client. Or follow the steps to send the SMS.

  • Import the twilio Client from
  • Get and store the account_sid and auth_token from the your Twilio account.
  • Make instance of the Client by passing account_sid and auth_token.
  • Now, get the from number from your Twilio account.
  • Now, send the message using client.messages.create(body=message, from_=from_number, to=verified_number).
  • You will get the message.


# importing the client from the twilio
from import Client
# Your Account Sid and Auth Token from twilio account
account_sid = [ACCOUNT_SID]
auth_token = [AUTH_TOKEN]
# instantiating the Client
client = Client(account_sid, auth_token)
# sending message
message = client.messages.create(body='Hi there! How are you?', from_=[FROM_NUM
# printing the sid after success

If the message is sent successfully, then you will get the hash code as follows without any



If you have any doubts in the tutorial, mention them in the comment section.