Skip to main content

Send SMS via Gmail SMTP servers.

Project description

pysendsms

pysendsms is a quick and simple way to use python to send SMS via Gmail SMTP servers to known a cell carrier.

Installation

Use the package manager pip to install pysendsms.

pip install pysendsms

Requires

  • A Gmail account with app specific password enabled for use. Manage Google Apps
  • Knowledge of which cell carrier provider the receiving party uses.

Usage

Import the library and create and SMS Object utilizing your gmail account and an application password created within your Google account.

import pysendsms

sms = pysendsms.SMS('<username>@gmail.com', '<app-password>')

Create an Contact object using the persons phone number and select a carrier from the avaible options.

CARRIERS is a dictionary loaded from a json file in the project that can be checked for available carriers that can be used for messaging.

contact = pysendsms.Contact('311-555-2368', 'AT&T')

Use the SMS.send() method of your SMS object, passing the Contact and the message you would like to send as a string.

sms.send(contact, 'Hello, World!')

SMS.send() can also accept a list of contacts for sending out group messages.

group = [contact, contact, contact, contact]

sms.send(group, 'Everyone gets a message!')

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysendsms-0.1.7.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file pysendsms-0.1.7.tar.gz.

File metadata

  • Download URL: pysendsms-0.1.7.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pysendsms-0.1.7.tar.gz
Algorithm Hash digest
SHA256 69447edb35e56236bafa9e5bf9c66e780c0d2deda2ea8a0495fe256dc0cfa671
MD5 5fa988038b7a994cb293bb7a03277aa1
BLAKE2b-256 28cd405182015480e02018c2d8919593f4277e6ad0e9f5898a8b1c85d4d8efe9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page