Skip to content
Send text messages from python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Send text messages from python


As found in

from gateways import GATEWAYS
from sender import PyMS

pyms = PyMS()
pyms.send_sms('1234567890', GATEWAYS['SPRINT']['SMS_EMAIL'], "Test")


PyMS uses a few default settings to make this all work. The following inputs can be provided to PyMS(...)

  • username the account username in the form Defaults to system environment variable PYMS_USERNAME
  • password the password for the account. Defaults to system environment variable PYMS_PASSWORD
  • host the SMTP server hostname. Defaults to
  • port the SMTP server port. Defaults to 465


As found out from radtek on Stack Overflow, you need to allow your Gmail account to work with a less secure app by flipping a switch here as this type of login is considered unsecure


PyMS uses SMS / MMS gateways to deliver messages to a mobile device. Most US carriers should be provided in the GATEWAYS dict in for usage. These gateways taken from here


Currently the carrier of the mobile device must be known to send a message

This may be overcome by hitting and scraping the results however it presents issues if a user changes there carrier but maintains the same phone number. Most other services are paid for including any API's that exist.

You can’t perform that action at this time.